User manual

!
USER MANUAL |
!
22!
The defined channels are:
1 Printer.
16 (10h) Optional card reader.
Commands for the printer channel (1):
Command 2 - Send data
The data is copied into the printer’s print buffer. If there’s not enough space into the print buffer
the packet is rejected, and a status byte with value 3 is returned in the answer.
Command 3 - Receive data
If there is data to be transmitted from the printer to the host, it is transmitted in the data field of
the packet, otherwise an empty packet is received. The application must take care to get the
data fast enough from the output buffer or the data may be corrupt.
Command 4 - Get printer status. 5 data bytes returned in response:
o BufferHi BufferLo PrStatus Volt Temperature
o BufferHi High byte of the count of free bytes in input buffer.
o BufferLo Low byte of the count of free bytes in input buffer.
o PrStatus Printer status. The following bits defined:
" Bit 0 Battery low
" Bit 1 Too hot
" Bit 2 No paper
o Volt - The battery voltage in units 0.1V
o Temperature - The head temperature in degrees Celsius.
If free bytes in input buffer are more than 65535 (FFFFh), then FFFFh is returned.
Using channel 16 is the only way for full control over the optional card reader.
Communication example (all bytes hexadecimal):
Send data:
o >>> 01 02 00 05 11 22 33 44 55
o <<< 81 00 00 00
Send data with error:
o >>> 01 02 00 05 11 22 33 44 55
o <<< 81 01 00 00
o >>> 01 02 00 05 11 22 33 44 55
o <<< 81 01 00 00
o >>> 01 02 00 05 11 22 33 44 55
o <<< 81 00 00 00
Receive data:
o >>> 01 03 00 00
o <<< 81 00 00 00
o >>> 01 03 00 00
o <<< 81 00 00 04 11 22 33 44
o >>> 01 03 00 00
o <<< 81 00 00 00
Get status:
o >>> 01 04 00 00
o <<< 81 00 00 05 3F F8 01 49 27