TMWriteFile Code Example

long session_handle;
unsigned char state_buffer[15360];
unsigned char write_buffer[500];
short len,file_handle;

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

/* get the unique registration number of the device to communicate with using TMFirst,TMNext,TMRom... */
...

/* file_handle set from call to TMCreateFile */
...

/* create the message to write to 'file_handle' */
sprintf(write_buffer,"This is a test");

/* write the file */
len = TMWriteFile(session_handle, state_buffer, file_handle, write_buffer, strlen(write_buffer));

if (len > 0)
{
   /* file was written */
   ...
}
else
{
   /* error writing file */
   ...
}

/* close the opened file with a call to TMCloseFile */
...

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