A SERVICE OF

logo

Page 47
Section 13 ... Extech IR-XMODEM Protocol
§ This is a proposed protocol for bi-directional data transfer through an Infrared channel. The
protocol is based on packet transfer utilizing checksum error detection. Format of the data
packet is shown below:
SOH (0x01) SEQ CSEQ ...DATA [128 Bytes]... Checksum
§ When powered on, the Extech printer will default to slave mode, requesting to receive
packets (sending a NAK character every 10 seconds). After receiving a magnetic card reader
request and the master closes the connection, the Extech printer switches to master mode. In
master mode the printer waits to receive a transmission request (NAK).
Summary of Extech IR-XMODEM transmission procedure:
Step Slave transmits: Master transmits: Notes:
1 NAK (0x16)
Packet send request (occurs every 10 seconds).
SEQ is reset to 1.
2
SOH (0x01)
"Start Of Header" character.
3
[SEQ]
Eight bit packet sequence number.
4
[CSEQ]
Ones complement of SEQ.
If end of data go to step 8.
5
DATA (128 Bytes)
6
8-bit Checksum
Sum of DATA bytes, ignoring overflow.
7A** ACK (0x06)
Checksum is CORRECT.
Increment SEQ (packet 0 comes after 255).
Master may send next data packet: Return to step 2.
7B** NAK (0x16)
Checksum is INCORRECT.
Master must retransmit data packet: Return to step 2.
End transmission and disconnect procedure:
8
EOT (0x04)
"End of transmission" character.
9
127 zeros
10
Checksum (0x04)
11A** ACK (0x06)
Checksum is CORRECT.
End of transfer.
11B** NAK (0x06)
Checksum is INCORRECT.
Master must retransmit data packet: Return to step 2.
**Note (steps 7A, 7B, 11A and 11B): If the master fails to receive an ACK or NAK within five
seconds of checksum transmission, the master must retransmit the packet.