TMFirstAlarm Overview Group

The TMFirstAlarm API call operates exactly like the function TMFirst, except that the search is limited to those parts with an active alarm interrupt pending. This allows a program to limit the scope of the search algorithm to only those parts that may require attention because an alarm condition has been set. The DS1994, DS1920, and DS2407 potentially have an alarm condition. The ROM data pattern that was found is stored in an internal eight byte buffer. The internal eight byte buffer can be read using the TMRom API call.


short far pascal TMFirstAlarm(

long session_handle,      // session handle for the desired 1-Wire network
void far *state_buffer    // state buffer provided for the 1-Wire network session
);

For a description of the above types, see the TMEX Type Descriptions.

Parameters

session_handle

Specifies the session handle returned from the API function TMExtendedStartSession that specifies the desired 1-Wire network port. This parameter is required by most TMEX API functions.

state_buffer

Specifies a pointer to a memory location that TMEX keeps all of the state information for the 1-Wire networks. This parameter is required by most TMEX API functions.

Return Value

0 => device not found

1 => first alarming device on the 1-Wire network found

<0 => TMEX Network Error Return Code

Code Example

See Also

TMFirst, TMRom, TMNextAlarm