The TMRom API call transfers a ROM data pattern between the internal eight-byte buffer maintained by the driver and an array 'ROM' of eight short integers declared in the application program. The direction of data transfer is specified by the value of the first integer in the array. If the first integer is zero, then the eight bytes from the internal buffer are transferred into the eight integer variables of the integer array. If the first integer is non-zero, then the least significant bytes of the eight integers are transferred into the internal eight-byte buffer. This function allows an application program to obtain the ROM data of a device that has been found with the TMFirst or TMNext functions. It also allows the application program to specify the ROM data of a specific device to be addressed with a multi-drop API call such as TMFirstFile. Note that only the least significant byte of each short integer in the ‘ROM’ array is used.
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.
ROM
Specifies a pointer to an short array with eight elements that either will read or set the internal ROM buffer.
Return Value
1 => ROM read or set
<0 => TMEX Network Error Return Code
See Also