4.2 WFS_CMD_IDC_WRITE_TRACK

Description For motor-driven card readers, the ID card unit checks whether a card has been inserted. If so, the data is written to the track as described in the form specified by the lpstrFormName parameter, and the other parameters.

If no card has been inserted, and for all other categories of devices, the ID card unit waits for the period of time specified in the WFSExecute call for a card to be either inserted or pulled through. The next step is writing the data defined by the form and the parameters to the respective track (see Section 6, Form Definition, for a more detailed description of the forms mechanism).

This procedure is followed by data verification.

Input Param LPWFSIDCWRITETRACK lpWriteTrack;

struct _wfs_idc_write_track
{
LPSTR lpstrFormName;
LPSTR lpstrTrackData;
} WFSIDCWRITETRACK, * LPWFSIDCWRITETRACK;

lpstrFormName
Points to the name of the form to be used.

lpstrTrackData
Points to the data to be used in the form.

Output Param None.

Error Codes The following additional error codes can be generated by this command:

Value Meaning

WFS_ERR_IDC_MEDIAJAM The card is jammed. Operator intervention is required.

WFS_ERR_IDC_SHUTTERFAIL The open of the shutter failed due to manipulation or hardware error. Operator intervention is required

WFS_ERR_IDC_NOMEDIA The card was removed before completion of the write operation.

WFS_ERR_IDC_INVALIDDATA An error occurred while writing the track.

WFS_ERR_IDC_DATASYNTAX The syntax of the data pointed to by lpstrTrackData is in error, or does not conform to the form definition.

WFS_ERR_IDC_INVALIDMEDIA No track found; card may have been inserted or pulled through the wrong way.

WFS_ERR_IDC_FORMNOTFOUND The specified form can not be found.

WFS_ERR_IDC_FORMINVALID The specified form definition is invalid (e.g., syntax error).

Events The following additional events can be generated by this command:

Value Meaning

WFS_EXEE_IDC_MEDIAINSERTED This event is generated when a card is detected in the device, giving early warning of card entry to an application, allowing it to remove a user prompt and/or do other processing while the card is being written.

WFS_SRVE_IDC_MEDIAREMOVED This event is generated when a card is removed before completion of a write operation.

Comments The field data is always preceded by the corresponding keyword, separated by an ‘=’. Fields are separated by 0x00. The end of the buffer is marked with an additional 0x00. (See the example below and Section 6, Form Definition.) This is a fundamental capability of an ID card unit; thus if a write request is received by a device with no write capability, the WFS_ERR_UNSUPP_COMMAND error is returned.

Example of lpstrTrackData:
RETRYCOUNT=3\0DATE=3132\0..\0\0