TMWritePacket Code Example

long session_handle;
unsigned char state_buffer[15360], write_buffer[100];
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 write a Universal Data Packet starting at page 0 */
sprintf(write_buffer,"HELLO TOUCH MEMORY");
len = TMWritePacket(session_handle, state_buffer, 0, write_buffer, strlen(write_buffer));

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

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