TMDoProgramJob Overview Group

The TMDoProgramJob API call writes all of the data that has been written to the EPROM device since the TMCreateProgramJob function was called. The write jobs are done one at a time until complete. This function marks off the jobs it has done so that if writing can not continue because the device has lost contact it can begin where it left off when it is called again. If this function fails and is not called again and allowed to complete, then the target device may be left in an unknown state. EPROMs are treated differently by TMEX because any write to an EPROM is destructive, meaning it uses up device memory. In NV-RAM devices, if an operation is unsuccessful then the function could then be just called again with no ill effects. If EPROMs were regarded in this way then some or all of the memory space could be lost. The TMDoProgramJob function is called again and again by the application program until all of the jobs are completed. This puts the onus on the application programmer to make sure that the EPROM device does not go away in mid write and waste memory space and leave the device in an unknown state. If the ROM is changed at any time before TMDoProgramJob is finished then the program job becomes invalid.


short far pascal TMDoProgramJob(

long session_handle,     // session handle for the desired 1-Wire network
void far *state_buffer   // state buffer provided for the 1-Wire network session
);

For a description of the above types, see the TMEX Type Descriptions.

Parameters

session_handle

Specifies the session handle returned from the API function TMExtendedStartSession that specifies the desired 1-Wire network port. This parameter is required by most TMEX API functions.

state_buffer

Specifies a pointer to a memory location that TMEX keeps all of the state information for the 1-Wire networks. This parameter is required by most TMEX API functions.

Return Value

1 => Program Job completed

<0 => TMEX File Operations Error Return Code

Code Example

See Also

TMCreateProgramJob