The TMSearch API call is a general purpose 1-Wire search. The search can have an optional 1-Wire reset performed before the search (PerformReset=1) or not (PerformReset=0). The ResetSearch parameter optionally resets the 1-Wire search parameters (ResetSearch=1) so that the API finds the ‘first’ device. The SearchCmd command supplies the 1-Wire search command to use.
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.
ResetSearch
Optionally resets the 1-Wire search parameters (ResetSearch=1) so that the API finds the ‘first’ device. With ResetSearch=0, the function will not reset the 1-Wire search parameters.
PerformReset
Specifies an optional 1-Wire reset performed before the search (PerformReset=1) or not (PerformReset=0).
SrchCmd.
Supplies the 1-Wire search command to use. Currently, there are two search commands available. The first is 0xFO (hexadecimal) for a regular search-rom command and the second is 0XEC (hexadecimal) for an interrupt (alarm) search.
Return Value
1 => 1-Wire device found
<0 => TMEX Network Error Return Code
See Also
TMFirst, TMFirstAlarm, TMNext, TMNextAlarm