TMReadPacket Code Example

long session_handle;
unsigned char state_buffer[15360], read_buffer[29];
short len;

/* session_handle set from a call to TMExtendedStartSession */
...

/* the internal 8-byte ROM buffer contains a valid ROM that is going to be selected to do a device specific operation */
...

/* attempt to read a Universal Data Packet on page 1 */
len = TMReadPacket(session_handle, state_buffer, 1, read_buffer, 29);

if (len >= 0)
{
   /* success, a Universal Data Packet was read and 
      its length is len */
   ...
}
else
{
   /* TRANSPORT error reading the DDS */
   ...
}

/* close the session with a call to TMEndSession */
...