Track data, Track 1 data, Track 2 data – MagTek USB HID SURESWIPE & USB HID SWIPE READER User Manual

Page 23: Track 3 data, Commands

Advertising
background image

Section 4. USB Communications

17

TRACK DATA

If decodable track data exists for a given track, it is located in the track data field that
corresponds to the track number. The length of each track data field is fixed at 110 bytes, but the
length of valid data in each field is determined by the track data length field that corresponds to
the track number. Track data located in positions greater than the track data length field
indicates are undefined and should be ignored. The HID specification requires that reports be
fixed in size, but the number of bytes encoded on a card may vary. Therefore, the Input Report
always contains the maximum amount of bytes that can be encoded on the card and the number
of valid bytes in each track is indicated by the track data length field. The track data is decoded
and converted to ASCII. The track data includes all data starting with the start sentinel and
ending with the end sentinel.

TRACK 1 DATA

This field contains the decoded track data for track 1.

TRACK 2 DATA

This field contains the decoded track data for track 2.

TRACK 3 DATA

This field contains the decoded track data for track 3.

COMMANDS

Most host applications do not need to send commands to the device. Most host applications only
need to obtain card data from the device as described previously in this section. This section of
the manual can be ignored by anyone who does not need to send commands to the device.

Command requests and responses are sent to and received from the device using feature reports.
Command requests are sent to the device using the HID class specific request Set Report. The
response to a command is retrieved from the device using the HID class specific request Get
Report. These requests are sent over the default control pipe. When a command request is sent,
the device will Nak the Status stage of the Set Report request until the command is completed.
This insures that, as soon as the Set Report request is completed, the Get Report request can be
sent to get the command response. The usage ID for the command message was shown
previously in the Usage Table.

The following table shows how the feature report is structured for command requests:

Offset

Field Name

0

Command Number

1

Data Length

2 – 23

Data

The following table shows how the feature report is structured for command responses.

Offset

Field Name

0

Result Code

1

Data Length

2 – 23

Data

Advertising