6.0. PC-Reader Communication Protocol
During normal operation, the BioCARDKey smart card reader acts as a slave with regard to the
communication between a computer and the device. The communication is carried out in the form of
successive command-response exchanges. The computer transmits a command to the reader and
receives a response from the reader after the command has been executed. A new command can be
transmitted to the BioCARDKey smart card reader only after the response to the previous command
has been received.
There are only two cases where the reader transmits data without having received a command from
the computer, namely, the Reset Message of the reader and the Card Status Message.
6.1. Command
6.1.1.
Normal Command (Length < 255 bytes)
A command consists of four protocol bytes and a variable number of data bytes and has the following
structure:
Byte
1
2
3
4 ... N+3 (0<N<255)
N+4
Header
Instruction
Data length = N
Data
Checksum
Header
Always
01
H
to indicate the start of a command.
Instruction
The instruction code of the command to be carried out by the BioCARDKey
Data Length
Number of subsequent data bytes. (0 < N < 255)
Data
Data contents of the command.
For a READ command, for example, the data bytes would specify the start address
and the number of bytes to be read. For a WRITE command, the data bytes would
specify the start address and the data to be written to the card.
The data bytes can represent values to be written to a card and/or command
parameters such as an address, a counter, etc.
Checksum
The checksum is computed by XORing all command bytes including header,
instruction, data length and all data bytes.
The following example shows the structure of a command with instruction code = 91
H
and three data
bytes with the values 11
H
, 22
H
and 33
H
, respectively:
byte 1 2 3 4 5 6 7
01
H
91
H
03
H
11
H
22
H
33
H
93
H
Document Title Here
Document Title Here
Document Title Here
AET60 Reference Manual
Version 1.7
Page 9 of 24
www.acs.com.hk