4.1 WFS_CMD_IDC_READ_TRACK

Description For motor driven card readers, the ID card unit checks whether a card has been inserted. If so, the tracks are read immediately as described in the form specified by the lpFormsName parameter.

If no card has been inserted, and for all other categories of card readers, 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. Again the next step is reading the tracks specified in the form (see Section 6, Form Definition, for a more detailed description of the forms mechanism). In addition to that, the results of a security check via a security module (i.e., MM, CIM86) are specified and added to the track data.

Input Param LPSTR lpstrFormName;

lpstrFormName
Points to the name of the form that defines the behavior for the reading of tracks (see Section 6, Form Definition)

Output Param LPSTR lpstrTrackData;

lpstrTrackData
Points to the data read successfully from the selected tracks (and value of security module if available).

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_INVALIDDATA The read operation specified by the forms definition could not be completed successfully due to invalid track data. This is returned if all tracks in an ‘or’ (|) operation cannot be read or if any track in an ‘and’ (&) operation cannot be read. lpstrTrackData points to data from the successfully read tracks (if any). One execute event (WFS_EXEE_IDC_INVALIDTRACKDATA) is generated for each specified track which could not be read successfully. See the form description for the rules defining how tracks are specified.

WFS_ERR_IDC_NOMEDIA No card was inserted within the specified time. For motor driven devices, the read is disabled; i.e., a card can not be inserted after a timeout.

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

WFS_ERR_IDC_SECURITYFAIL The security module failed reading the cards security sign.

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

Value Meaning

WFS_EXEE_IDC_INVALIDTRACKDATA One event is generated for each blank track (no data) or invalid track (either data error reading the track or the data does not conform to the specified form definition).

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

WFS_SRVE_IDC_MEDIAREMOVED This event is generated when a card is removed before completion of a read 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 The track data is preceded by the keyword for the track, separated by a ‘:’. The field data is always preceded by the corresponding keyword, separated by a ‘=’. The fields are separated by 0x00. The data of the different tracks is separated by an additional 0x00. The end of the buffer is marked by another additional 0x00 (see example below). Data encoding is defined in Section 6, Form Definition.

Example of lpstrTrackData:
TRACK2:ALL=47..\0\0TRACK3:MII=59\0PAN=500..\0\0\0