Section 4. properties and commands, Sending commands, Xon/xoff – MagTek PORT POWERED SWIPE READER User Manual

Page 21

Advertising
background image

15

SECTION 4. PROPERTIES AND COMMANDS


A full set of properties and commands have been incorporated into the new version of the Port
Powered Swipe Reader. This section describes the function and operation of each of these
properties, and shows how to implement the commands.

SENDING COMMANDS

The Reader will operate from 2400 to 115200 bps but each command sent to the Reader must
match the communication parameters of the Reader. The default communication parameters are
9600 bps with 8 bits, no parity and 1 stop bit (8N1). If the Reader fails to respond after a
command has been transmitted, the application should modify the transmission parameters until
a response is received.

Commands, as described below, must be preceded by an Escape (<ESC> – 0x1B) character and
be terminated by a Carriage Return (<CR> – 0x0D). All commands are case sensitive—that is,
they must all use upper case characters.

After a valid command has been received, the Reader will respond with an Acknowledge
(<ACK> – 0x06) within one character time. If a message is started but not completed within 2
seconds, a No-acknowledge (<NAK> – 0x15) will be transmitted; also, if the baud rate or other
communication settings are incorrect, the Reader will transmit a NAK using its current
communication parameters. An unrecognized command will also return a NAK.

XON/XOFF

The Reader can be placed into a “silent” mode so that it will not transmit or receive anything
until requested to do so. This may be useful with interrupt-driven applications where the Reader
should be disabled. The default for the Reader after a reset is XON.

After an XOFF (0x13) has been received and after completing any transmission that may be in
progress, the Reader will respond with an ACK and then hold card data in buffer. The data will
not be transmitted until an XON has been received. In this mode, only the most recent card
swipe will be available; any prior card swipes will be erased. Additionally, when in the XOFF
mode, all commands will be ignored (until an XON is received or until a hardware reset).

When an XON (0x11) has been received, the Reader will transmit an ACK followed by the data
in the buffer (from the last swiped card) if available. The buffer will be cleared after the data has
been transmitted. If the buffer is empty, only an ACK will be transmitted.

Advertising