...the world's most energy friendly microcontrollers
2014-01-23 - an0820_Rev1.00
7
www.silabs.com
Part 4 of the 7816 standard also defines a file system API to manipulate files and a security service API
allowing smart card and reader to mutually authenticate with each other. This is not discussed further
in this application note.
2.3.1 Protocol Data Units
The data units transmitted in the link-layer protocol is called transmission protocol data units (TPDUs).
These are the packets of data going between the reader and the smart card. On top of these are
the APDUs, which comes directly from the application layer of the protocol. The APDUs are usually
transmitted unaltered by the smart card interface device, but this depends on the level of automatism
supported by the reader. This naming convention is illustrated in Figure 2.5 (p. 7) .
Figure 2.5. Protocol Data Units and Where they Apply
Host Applicat ion
Sm art Card
Reader
Applicat ion Prot ocol
Dat a Unit s
(APDU)
Transm ission Prot ocol
Dat a Unit s
(TPDU)
CPU
Physical/ Link-
Layer
APDU
Sm art Card
2.3.2 T=0 Protocol Introduction
The link-layer protocol is usually one of two variants, either a byte-oriented protocol with error handling
performed on each byte by using a parity bit, or a block-oriented protocol with checksum-based error
detection. The first one, the byte-oriented protocol is called "T=0". The name comes from the indication
of this protocol in the ATR by having one of the bits in one of the T-characters equal to 0. The block-
oriented protocol is called "T=1". In fact there is even a T=2 protocol for full-duplex interfaces, with
T=3-15 reserved for future protocols.
The T=0 protocol re-uses the same byte-transmission format used during the ATR-sequence. The
parity error detection and retransmission at byte-level is also re-used. The TPDU-messages exchanged
between reader and smart card has two distinct structures, based on the direction of communication:
• A command, this is sent from reader to smart card. Consists of at least 5 characters named: CLA,
INS, P1, P2, P3, in addition comes a number of data bytes if writing to the smart card.
• CLA: Class designation of the command set to establish a collection of instructions.
• INS: The INS byte is used to identify a specific instruction within a class of instructions identified
by the CLA value.
• P1: Used to specify the addressing used by the [CLA, INS] instruction.
• P2: Also used to specify the addressing used by the [CLA, INS] instruction.
• P3: Specifies the number of data bytes transferred to or from the card as part of the [CLA, INS]
instruction execution.
• A response, this is sent from smart card to reader. Consists of 1 or 2 status characters named SW1
and SW2, in addition comes a number of data bytes if reading from the smart card. The SW1 byte
is also called "procedure-byte" if it is just an ACK or NULL character, indicating that the card is not
finished with the transaction.
Summary of Contents for EFM32
Page 27: ......