4.8 WFS_CMD_IDC_WRITE_RAW_DATA

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 tracks.

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 to the respective tracks.

The application must pass the magnetic stripe data in ASCII without any sentinels. The data will be converted by the service provider.

This procedure is followed by data verification.

Input Param LPWFSIDCCARDDATA *lppCardData;
Pointer to a null-terminated array of pointers to card data structures:

struct _wfs_idc_card_data
{
WORD wDataSource;
WORD wStatus;
ULONG ulDataLength;
LPBYTE lpbData;
} WFSIDCCARDDATA, * LPWFSIDCCARDDATA;

wDataSource

Specifies the source of the card data as one of the following flags:

Value Meaning

WFS_IDC_TRACK1 lpbData contains data to be written to track 1.

WFS_IDC_TRACK2 lpbData contains data to be written to track 2.

WFS_IDC_TRACK3 lpbData contains data to be written to track 3.

wStatus
This parameter is ignored by this command.

ulDataLength

Specifies the length of the following field lpbData.

lpbData

Points to the data to be written to the track.

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 action.

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

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.

WFS_EXEE_IDC_INVALIDMEDIA The user is attempting to insert the media in the wrong orientation. The card has not been accepted into the device. The device is still ready to accept a card inserted in the correct orientation.

Comments 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.