TMReadFile Code Example

long session_handle;
unsigned char state_buffer[15360];
unsigned char read_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 TMOpenFile */
...

len = TMReadFile(session_handle, state_buffer, file_handle, read_buffer, 500);

if (len >= 0)
{
   /* file read with length 'len' */
   ...
}
else
{
   /* error reading the file */
   ...
}

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

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