TMProgramBlock Code Example

long session_handle;
unsigned char state_buffer[15360], write_buffer[10];
short len, bits;

/* 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 */
bits = 8;
len = TMProgramBlock(session_handle, state_buffer, write_buffer, 10, 0, &bits);

if (len >= 0)
{
   /* success, data written of length len */
   ...
}
else
{
   /* TRANSPORT error */
   ...
}

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