SCM SCR331-DI Technical Manual

  • Hello! I am an AI chatbot trained to assist you with the SCM SCR331-DI Technical Manual. I’ve already reviewed the document and can help you find the information you need or explain it in simple terms. Just ask your questions, and providing more details will help me assist you more effectively!
SCR331-DI Product Technical Manual
SCR331-DI
Dual interface (Contact / Contact-less) USB
Smart card reader
Product Technical Manual
Version No 1.8
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 1 of 36
SCR331-DI Product Technical Manual
Contents
1.0 Introduction...................................................................................................................................4
2.0 Terms and Abbreviations .............................................................................................................5
3.0 Product Specifications..................................................................................................................5
3.1 Features....................................................................................................................................5
3.2 Hardware Specifics...................................................................................................................6
3.2.1 Adapter Power...................................................................................................................6
3.2.2 LED Behavior ....................................................................................................................6
3.2.3 Clock frequency.................................................................................................................7
3.2.4 Smart Card Slot Details.....................................................................................................7
3.3 Software Specifics .................................................................................................................... 8
3.3.1 Operating systems ............................................................................................................ 8
3.3.2 ICC parameters .................................................................................................................8
3.3.3 PICC parameters............................................................................................................... 9
3.3.4 USB parameters................................................................................................................9
3.4 Diver Firmware Communication Diagram ..............................................................................10
3.4.1 Dual Driver Architecture ..................................................................................................10
3.4.2 Single Driver Architecture................................................................................................ 11
4.0 Software Modules.......................................................................................................................12
4.1 Firmware.................................................................................................................................12
4.2 USB Drivers ............................................................................................................................ 12
4.3 Utilities ....................................................................................................................................12
4.3.1 Installation .......................................................................................................................12
4.3.2 DFU Utility ....................................................................................................................... 12
4.4 USB Interface ......................................................................................................................... 13
4.4.1.1 Slot Support............................................................................................................................... 13
4.4.1.2 Voltage Support......................................................................................................................... 13
4.4.1.3 Protocols Supported.................................................................................................................. 13
4.4.1.4 ICC Clock Frequency ................................................................................................................ 13
4.4.1.5 ICC I/O Data Rate ..................................................................................................................... 13
4.4.1.6 Synchronous Protocols ............................................................................................................. 13
4.4.2 CCID class requests supported....................................................................................... 13
4.4.3 CCID messages supported .............................................................................................13
4.4.4 CCID Error Codes ........................................................................................................... 14
4.4.4.1 HW_ERROR ............................................................................................................................. 14
4.4.4.2 XFR_PARITY_ERROR ............................................................................................................. 14
4.4.4.3 BAD_ATR_TS ........................................................................................................................... 14
4.4.4.4 BAD_ATR_TCK......................................................................................................................... 14
4.4.4.5 ICC_MUTE................................................................................................................................ 14
4.4.5 Note on WTX Handling.................................................................................................... 14
4.4.6 Note on Automatic PPS implementation ......................................................................... 15
4.5 PICC Implementation .............................................................................................................15
4.5.1 ATR Handling .................................................................................................................. 15
4.5.2 TYPE A Memory card supplying an ATR ........................................................................ 15
4.5.3 TYPE A T=CL - ATR ....................................................................................................... 16
4.5.4 TYPE B supplying an ATR .............................................................................................. 16
4.5.5 PICC T=1 Emulation........................................................................................................ 17
4.5.6 Overview of Contact-less APDU Set............................................................................... 18
4.5.7 Detailed description of the APDU set.............................................................................. 19
4.5.7.1 Memory card APDU Set ............................................................................................................19
4.5.7.2 T=CL card APDU Set ................................................................................................................ 24
5.0 PICC ESCAPE IMPLEMENTATION .......................................................................................... 27
5.1 Table indicating the PICC Escape function values................................................................. 27
5.2 READER_CNTLESS_SEND_REQ ........................................................................................ 28
5.3 READER_CNTLESS_SEND_LOOP...................................................................................... 28
5.4 READER_CNTLESS_GET_MFRC_REV...............................................................................28
5.5 READER_CNTLESS_GET_ATS............................................................................................ 28
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 2 of 36
SCR331-DI Product Technical Manual
5.6 READER_CNTLESS_GET_TYPE .........................................................................................28
5.7 READER_CNTLESS_SET_TYPE.......................................................................................... 28
5.8 READER_CNTLESS_RF_SWITCH....................................................................................... 29
5.9 READER_CNTLESS_RAW_CFG.......................................................................................... 29
5.10 READER_CNTLESS_RAW_XMIT ..................................................................................... 30
5.11 READER_ CNTLESS_DISABLE_PPS............................................................................... 30
5.12 READER_CNTLESS_PUPI ................................................................................................30
5.13 READER_SWITCH_RF_ON_OFF ..................................................................................... 31
6.0 Appendix A ................................................................................................................................. 31
6.1 Status Words Table ................................................................................................................31
7.0 Appendix B ................................................................................................................................. 32
7.1 Samples of SCR331-DI contact-less communications........................................................... 32
7.1.1 Simple APDU................................................................................................................... 32
8.0 Appendix C................................................................................................................................. 33
8.1 Sample Code for using Escape messages through Escape IOCTL ..................................... 33
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 3 of 36
SCR331-DI Product Technical Manual
1.0 Introduction
This document contains information that allows a developer of host software to integrate an interface
to contact-less cards in SCR331-DI dual interface smart card reader.
This document describes the interfaces that will be provided by our SCR331-DI devices to support
contact and contact-less operation. This contains details on what kind of APDUs for contact-less
memory cards and T=CL type of cards is provided, their details and how applications can build a set
of APDUs corresponding to contact-less cards. Also a note on the CCID implementation of the USB
interface is also provided.
1.1 Purpose
This document provides the features and technical details of the SCR331 USB smart card Reader,
hereafter referred to as “SCR331-DI Product”. This manual explains the technicalities and the
functional features of the product. This lays down software and the hardware features and the
firmware support. Also, a comparison of this product with other standard SCM smart card products is
given.
1.2 Scope
This document describes the technical implementation of the product from an engineering standpoint,
which is targeted ONLY for OEMs and application providers. This can be the base document for
preparing end user manuals. Also, readers are assumed to have familiarity with commonly used
engineering terms and the specification documents mentioned in the reference section of this
document.
This document deals with the support of contact-less at the firmware level for SCR331-DI dual
interface smart card readers. This is implemented in a generic macro approach and is supported by
the Vendor defined generic APDU set for Type A, Type B memory card and T=CL type of contact-less
cards. Applications can access through these APDUs using generic PC/SC transport layer.
The scope of the contact-less card support is to provide an intermediate level of intelligence to the
reader (like handling of protocol specifics for Type A, Type B) and let the application programmers
have the flexibility to handle all the card specific requirements. With this set of APDUs virtually all the
contact-less cards could be supported. Also this document deals with the support of contact smart
cards at the firmware level for this reader interface.
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 4 of 36
SCR331-DI Product Technical Manual
2.0 Terms and Abbreviations
Acronym/Abbreviation Expansion
APDU Application Protocol Data Unit
CCID Chip Card Interface Device
CID Card Identifier
CL Contact-Less
FWI Frame Waiting Time
Mifare The ISO14443 with extensions for security (PHILIPS).
NAD Node Address
PCD Proximity Coupling Device
PCSC Personal computer Smart card
PICC Proximity Integrated Chip Card
Proximity Distance coverage till 10 cm.
PUPI Pseudo unique PICC identifier
RF Radio Frequency
STCII Smart card reader controller ASIC from SCM Microsystems
USB Universal Serial Bus
WI Wait Time Integer
3.0 Product Specifications
3.1 Features
PC/SC 1.0 compliant drivers – including the contact-less interface
Type A – CL , Type B – CL , Mifare, Memory card support
T=1 simulation for contactless
USB CCID like Host interface handled by SCM vendor drivers
USB2.0 compliant full speed device
High bus-powered through USB
SCM Vendor drivers for all WINTEL platforms ( except WINNT4.0)
Device firmware upgradeable in the field through USB
Remote wakeup of host machine, on card insertion or removal – Contact only
WHQL compliant drivers for WINXP platform
ISO7816 compliant contact smart card interface
ISO14443 compliant contact-less smart card interface
One dual color LED indicating different states of the reader.
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 5 of 36
SCR331-DI Product Technical Manual
3.2 Hardware Specifics
3.2.1 Adapter Power
High Bus Powered (>100 mA and <500mA) (draws power from the USB bus), for USB
operation
3.2.2 LED Behavior
By default, the RF Field is switched off when a contact card is present in the contact slot. However the
firmware can be configured before loading to the device (not in run time) so that the RF Field is ON
even in presence of CONTACT card in the CONTACT slot. The LED behavior for both the firmware
configurations is given below. For details about the two different driver architectures (single/dual)
please see chapter 4.2.
SCR331-DI Firmware Ver 6.18; Driver Ver 4.30.00.01; PCB Rev 1.4
SCR331-DI DUAL SLOT FIRMWARE LED STATUS
LED States
LED1 (GREEN) LED2 (RED)
Just after plug-in (with drivers
already installed)
ON OFF
Just after DFU operation
ON OFF
Suspend / standby
OFF OFF
Reader powered, Contact card IN,
but not powered (98/ME - issue
power down using the
Testresman utility)
500ms ON
500ms OFF
OFF
Reader powered, Contact card IN,
but not powered (2K/XP - power
down takes place )
ON OFF
ICC Powered / Communication
500ms ON
500ms OFF
OFF
PICC Powered / Communication
500ms ON
500ms OFF
OFF
Reader / card errors
OFF
100ms ON
100ms OFF
Firmware upgrade running
OFF ON
COMBI CARD powered in contact
slot
500ms ON
500ms OFF
OFF
COMBI CARD powered using RF
field
ON
ON
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 6 of 36
SCR331-DI Product Technical Manual
SCR331-DI SINGLE SLOT FIRMWARE LED STATUS
LED States
LED1 (GREEN) LED2 (RED)
Just after plug-in (with drivers
already installed)
ON OFF
Just after DFU operation
ON OFF
Suspend / standby
OFF OFF
Reader powered, Contact card IN,
but not powered (98/ME - issue
power down using the
Testresman utility)
500ms ON
500ms OFF
OFF
Reader powered, Contact card IN,
but not powered (2K/XP - power
down takes place )
ON OFF
ICC Powered / Communication
500ms ON
500ms OFF
OFF
PICC Powered / Communication
ON
ON
Reader / card errors
OFF
100ms ON
100ms OFF
Firmware upgrade running
OFF ON
COMBI CARD powered in contact
slot
500ms ON
500ms OFF
OFF
COMBI CARD powered using RF
field
ON
ON
3.2.3 Clock frequency
STC-II running @24 MHz for USB operation
ICC clock @4MHz
PICC clock @13.56MHz using MIFARE RC531 chip
3.2.4 Smart Card Slot Details
Single smart card slot implemented.
Manual ejection mechanism
Class A or AB cards ONLY; No support for B only cards
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 7 of 36
SCR331-DI Product Technical Manual
3.3 Software Specifics
3.3.1 Operating systems
Generic device firmware
Vendor drivers for WIN98SE, WINME , WIN2000, WINXP, Windows Server 2003, Win CE
3.3.2 ICC parameters
Some important smart card parameters, supported smart card types, maximum operable smart card
frequencies, operating voltages etc., are detailed in the tables below.
ICC Parameters Value/Description
Class A Smart Cards Supported
Class AB Smart Cards Supported
Asynchronous Smart Cards Supported
ISO-7816 compliant Yes
EMV’2000 compliant Not yet validated
PC/SC compliant Yes
WHQL compliant Yes ( Windows 2000, Windows XP, Windows Server
2003)
CT-API compliant Yes
Smart card operating frequency 4MHz
Maximum supported card baud-rate 250K
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 8 of 36
SCR331-DI Product Technical Manual
3.3.3 PICC parameters
Some important PICC parameters, supported contact-less card types, maximum operable PICC
frequencies, operating voltages etc., are detailed in the tables below.
ICC Parameters Value/Description
Type A memory card PICC Supported (Through SCM Specific APDUs)
Type A T=CL PICC Supported
Type B memory card PICC Supported (Through SCM Specific APDUs)
Type B T=CL PICC Supported
ISO-14443 compliant Yes
PC/SC compliant Yes ( Contactless cards simulated as T=1 cards)
WHQL compliant Yes ( Windows 2000, Windows XP, Windows Server
2003)
PICC operating frequency 13.56MHz
Maximum supported card baud-rate 424Kbps
3.3.4 USB parameters
USB Parameters Value/Description
USB Specification USB 2.0 FS Device
USB Speed Full Speed Device (12Mbit/s)
Device Class Vendor
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 9 of 36
SCR331-DI Product Technical Manual
3.4 Diver Firmware Communication Diagram
3.4.1 Dual Driver Architecture
PICC
CONTACT READER
CONTACTLESS READER
PCSC
LAYER
FIRMWARE
LAYER
UPPER
DRIVER
CL
SMARTCARD
READER
LOWER
DRIVER
CONTACT
SMARTCARD
READER
ICC
SLOT O
T = CL to T= 1
Conversion
SCR 331 DI
READER
S
L
O
T
1
T = 0 / T = 1
T = CL
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 10 of 36
SCR331-DI Product Technical Manual
3.4.2 Single Driver Architecture
FIRMWARE
LAYER
ICC
(PRIORITY)
OR
PICC
SCR 331 DI
READER
PCSC
LAYER
SCM SINGLE READER
SCM DUAL INTERFACE
READER
T = 0
T = CL
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 11 of 36
SCR331-DI Product Technical Manual
4.0 Software Modules
4.1 Firmware
Device firmware that supports USB interfaces is provided.
On USB, the firmware implements dual slot architecture – one slot for the CONTACT interface
and another for the CONTACT-LESS interface.
4.2 USB Drivers
Two driver packages have been provided – a SINGLE driver package and a DUAL driver package
SINGLE DRIVER PACKAGE
Only one driver gets loaded and the same driver handles both the CONTACT and CONTACT-LESS
operations. However though we have a dual slot firmware EITHER one of CONTACT or
CONTACTLESS are be accessed at a time.
DUAL DRIVER PACKAGE
Two drivers are loaded and two readers are seen at the host level.
SCM Microsystems Inc. SCR331-DI Smart Card Reader
It is a CONTACT-ONLY reader.
SCM Microsystems Inc. SCR331-DI USB ContactlessReader
It is a CONTACT- LESS-ONLY reader.
The advantage is that two slots of the reader can be accessed simultaneously. But as discussed in
section 4.2.2 LED behavior, when the firmware is configured in the mode, where the RF field is
powered OFF during CONTACT card presence, the real Dual slot feature is lost.
4.3 Utilities
4.3.1 Installation
SCM provides Install Shield Installer for Windows to install the product. The SCM drivers as well as
the utilities can be installed with the help of this installer.
4.3.2 DFU Utility
DFU utilities/drivers for dynamic Device Firmware Upgrade (DFU) are shipped with the device for
USB interface. DFU utilities/drivers are capable of performing a DFU under the following operating
systems.
Operating System Support
WIN98 Yes
WINME Yes
WIN2000 Yes
WINXP Yes
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 12 of 36
SCR331-DI Product Technical Manual
4.4 USB Interface
The SCR331DI USB Smart Card Reader implements a transport protocol that is compliant with
Universal Serial Bus Device Class Specification for USB Chip/Smart Card Interface Devices Revision
1.00.
The following sections of this document describe about the features that are implemented/ NOT
implemented vis-à-vis the CCID specification.
4.4.1.1 Slot Support
The current implementation supports dual slots.
4.4.1.2 Voltage Support
The voltage supported is 5.0 Volts only.
4.4.1.3 Protocols Supported
The firmware supports both the T = 0 and T = 1 protocols for ICC and T = 1 protocol for PICC.
4.4.1.4 ICC Clock Frequency
The default ICC clock frequency is 4 MHz. Manual selection of the clock is not supported.
4.4.1.5 ICC I/O Data Rate
The default ICC I/O data rate is 9600 bps and the maximum supported data rate is 250 Kbps.
Selection of the data rate is supported by the CCID message PC_TO_RDR_SETPARAMETERS.
4.4.1.6 Synchronous Protocols
No support is given for synchronous protocols.
4.4.2 CCID class requests supported
Abort
Only the above class specific request has been supported.
4.4.3 CCID messages supported
The following CCID messages have been implemented (bulk-out):
PC_to_RDR_IccPowerOn
PC_to_RDR_IccPowerOff
PC_to_RDR_GetSlotStatus
PC_to_RDR_XfrBlock
PC_to_RDR_GetParameters
PC_to_RDR_SetParameters
PC_to_RDR_Escape
PC_to_RDR_Abort
PC_to_RDR_NotifySlotChange
The following CCID messages are NOT implemented and hence fail with command not supported
error:
PC_to_RDR_ResetParameters
PC_to_RDR_IccClock
PC_to_RDR_T0APDU
PC_to_RDR_Secure
PC_to_RDR_Mechanical
PC_to_RDR_SetDataRateAndClockFrequency
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 13 of 36
SCR331-DI Product Technical Manual
4.4.4 CCID Error Codes
Extensive error codes are reported on many conditions during all CCID responses. Most of the error
messages are reported by the CCID appropriately. Some of the main error codes are:
HW_ERROR
XFR_PARITY_ERROR
BAD_ATR_TS
BAD_ATR_TCK
ICC_MUTE
The following sub-sections discuss when and why these error codes are returned:
4.4.4.1 HW_ERROR
This error code is returned when a hardware short circuit condition is detected, during application of
power to the card. This error code has been defined in the error code table under section “Appendix
1” of the CCID specification.
4.4.4.2 XFR_PARITY_ERROR
This error code is returned when a parity error condition is detected. This error will be reported in the
response to a PC_to_RDR_XfrBlock message. This error code has been defined in the error code
table under section “Appendix 1” of the CCID specification.
4.4.4.3 BAD_ATR_TS
This error code is returned when a bad TS character is detected, during application of power to the
card. This error will be reported in the response to a PC_to_RDR_IccPowerOn message. This error
code has been defined in the error code table under section “Appendix 1” of the CCID specification.
4.4.4.4 BAD_ATR_TCK
This error code is returned when the TCK of the received ATR is incorrect. This error will be reported
in the response to a PC_to_RDR_IccPowerOn message. This error code has been defined in the
error code table under section “Appendix 1” of the CCID specification.
4.4.4.5 ICC_MUTE
This error code is returned when the card does not respond until the reader time out occurs. This error
will be reported in the response to PC_to_RDR_XfrBlock message and PC_to_RDR_IccPowerOn
messages. This error code has been defined in the error code table under section “Appendix 1” of the
CCID specification.
4.4.5 Note on WTX handling
For Contact cards:
For T = 1 Protocol: As per the CCID specification requirements, Sec4.1.4, the bBWI field of the
PC_to_RDR_XfrBlock message, shall be used to extend the CCIDs Block Waiting Timeout for this
current transfer. The CCID will timeout the block after “this number multiplied by the Block Waiting
Time” has expired.
The firmware, on receiving the WTX request from the card, notifies it to the host driver. The driver
shall set the requested WTX value in the bBWI field of the subsequent PC_to_RDR_XfrBlock.
For T = 0 Protocol: The firmware on receiving the NULL (0x60) Procedure byte from the card, notifies
it to the driver using the RDR_to_PC_DataBlock response. During this period, the reception of bytes
from the smart card is still in progress and hence the device cannot indefinitely wait for IN tokens on
the USB bulk-in endpoint. Hence, it is required of the driver to readily supply ‘IN’ tokens on the USB
bulk-in endpoint. On failure to do so, some of the wait time extension responses, will not be queued to
the driver.
For Contactless cards:
The WTX is handled within the Firmware.
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 14 of 36
SCR331-DI Product Technical Manual
4.4.6 Note on Automatic PPS implementation
The CCID host driver shall use the PC_to_RDR_SetParamters message to set the F and D values.
This is described in the CCID specification requirements, Sec4.1.7.
For contactless part by default the reader switches to the maximum speed indicated by the card
parameters. This auto-high speed switching can be disabled / enabled by an escape message (Ref
Section 6.9). Currently the reader and the card switch to the same speed for sending & reception.
4.5 PICC Implementation
4.5.1 ATR Handling
During power-up sequence, the firmware generates a T=1 compatible ATR. Depending on whether
the PUPI bytes are enabled/disabled (see chapter 5.12 about details how to control this feature), the
PUPI bytes are part of the ATR or skipped. FWI, CID and NAD information returned by the card are
also appended as the historical bytes. For versions of firmware from 5.10 and above, the PUPI bytes
have been stripped by default from the ATR. The PICC implementation is compliant to PCSC 1.0
specification. This is achieved by simulating the contactless card through T=1 protocol.
4.5.2 TYPE A Memory card supplying an ATR
The ATR obtained from the card, which contains PUPI length of serial numbers, and some additional
card parameters like SAK byte, type of card (T=CL supported or not) etc are sent as historic bytes of
a T = 1 protocol ATR.
0x3B Proprietary
0Xfx X indicates the number of bytes following
0x91 Proprietary
0x00 Proprietary
0xFF Proprietary
0x91 Proprietary
0x81 Proprietary
0x71 Proprietary
0xFE Proprietary
0x40 Proprietary
0x00 Proprietary
TYPEA TYPE A parameter should be 0x41 as per PCSC2.0 specification
SAK
Selective Acknowledgement information, Using this value, application
identifies whether card type is Mifare or T=CL card
PUPI Length Length of PUPI bytes that follow
PUPI PUPI bytes of Length PUPI Length
CARD_PARAM1 CARD_PARAM1 is 0x00 and indicates that the card is a memory card
CARD_PARAM2 CARD_PARAM2 is 0x00
TCk The TCk byte in T = 1 protocol
The PUPI bytes can be enabled/disabled using an escape message
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 15 of 36
SCR331-DI Product Technical Manual
4.5.3 TYPE A T=CL - ATR
The ATR obtained from the card, which contains PUPI length of serial numbers, and some additional
card parameters like SAK byte, type of card (T=CL supported or not) etc are sent as historic bytes of
a T = 1 protocol based simulated ATR.
0x3B Proprietary
0xFX X indicates the number of bytes following
0x91 Proprietary
0x00 Proprietary
0xFF Proprietary
0x91 Proprietary
0x81 Proprietary
0x71 Proprietary
0xFE Proprietary
0x40 Proprietary
0x00 Proprietary
TYPEA TYPE A parameter should be 0x41 as per PCSC2.0 specification
SAK
Selective Acknowledgement information, Using this value, application
identifies whether card type is Mifare or T=CL card
PUPI Length Length of PUPI bytes that follow
PUPI PUPI bytes of Length PUPI Length
CARD_PARAM1 CARD_PARAM1
CARD_PARAM2 CARD_PARAM2
CARD_PARAM3 CARD_PARAM3
Historical Bytes Historical Bytes from the card
TCk The TCk byte in T = 1 protocol
¾ Type A contact-less card is concerned, possible PUPI_LEN are 4, 7 and 10 bytes.
¾ TYPE A parameter should be 0x41 as per PCSC2.0 specification
¾ Higher nibble of CARD_PARAM1 is 0xY1 and where Y indicates the SFGI value and the
lower nibble states that the card supports T=CL.
¾ CARD_PARAM2 contains Baud rate integer value
¾ CARD_PARAM3 contains Wait time integer, CID supported and NAD information. The higher
nibble contains the wait time integer. The bit 0 (lsb) of the lower nibble is a boolean indicating
whether the card supports NAD addressing and bit 1 of the lower nibble is a boolean
indicating whether the card supports CID.
¾ Historical Bytes
The historical bytes obtained from the ATS are included as the historical bytes of the T=1
ATR. The number of historical bytes to be included is configurable in the firmware. The
number of historical bytes to be appended to the ATR is also configurable. If the number of
historical bytes is more than the maximum length available in the ATR, then the First n bytes
or the last n bytes are appended to the ATR depending on the firmware configuration to
configure the first n bytes or the last n bytes.
4.5.4 TYPE B supplying an ATR
The ATR obtained from the card, which contains PUPI length of serial numbers, and some additional
card parameters are sent as historic bytes of a T = 1 protocol ATR.
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 16 of 36
SCR331-DI Product Technical Manual
0x3B Proprietary
0xFX X indicates the number of bytes following
0x91 Proprietary
0x00 Proprietary
0xFF Proprietary
0x91 Proprietary
0x81 Proprietary
0x71 Proprietary
0xFE Proprietary
0x40 Proprietary
0x00 Proprietary
TYPEB TYPE B parameter should be 0x42 as per PCSC2.0 specification
PUPI Length Length of PUPI bytes that follow
PUPI PUPI bytes of Length PUPI Length
CARD_PARAM1 CARD_PARAM1
CARD_PARAM2 CARD_PARAM2
CARD_PARAM3 CARD_PARAM3
TCk The TCk byte in T = 1 protocol
¾ For Type B contact-less card the possible PUPI_LEN is 4.
¾ TYPE B parameter should be 0x42 as per PCSC2.0 specification
¾ CARD_PARAM1 indicates whether the card support memory card or T=CL card.
CARD_PARAM1 value of 0x00 indicates TYPE B memory card and value of 0x01 indicates
TYPE B T=CL card.
¾ CARD_PARAM2 contains Baud rate integer value
¾ CARD_PARAM3 contains Wait time integer, CID supported and NAD information. The higher
nibble contains the wait time integer. The bit 0 (lsb) of the lower nibble is a boolean indicating
whether the card supports NAD addressing and bit 1 of the lower nibble is a boolean
indicating whether the card supports CID.
4.5.5 PICC T=1 Emulation
PICC transmission part is simulated as PCSC 1.0 based T=1 protocol. All PCSC host APDU are
transferred in to the SCR331-DI firmware as CCID messages. As far as the SCR331-DI firmware is
concerned, it should accept only CCID messages for both ICC and PICC implementation. So the
application provides does not bother about the implementation of Host applications.
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 17 of 36
SCR331-DI Product Technical Manual
4.5.6 Overview of Contact-less APDU Set
Memory card APDU Set
Command CLA INS P1 P2 P3 Data
ISO7816_READ_BINARY 0xFC
0xB0
Block No. RFU 0x00 None
ISO7816_WRITE_BINARY 0xFC
0xD0
Block No. RFU Length Lc bytes
ISO7816_VERIFY 0xFC
0x20
AUTH_KEY RFU Key Length Lc bytes
ISO7816_USER_CMD 0xFC
0xFE
RFU RFU Cmd Len Cmd
ISO7816_VALUE_BLOCK 0xFC
0xF0
Block No. Value-
Param
Value bytes Value, Block
No.
T=CL card APDU Set
Command CLA INS P1 P2 P3 Data
T=CL command ISO 7816 part 4 complaint command
T=CL user command 0xFC
0xFE
RFU RFU Length APDU bytes
T=CL GET IFSC command 0xFC
0xFD
RFU RFU 0x00 None
The P1 field of the Read/Write Byte APDU contains the block number of Type A contact-less
memory cards.
The P1 field of the Verify Byte APDU contains the Key type like AUTHKEY_A, AUTHKEY_B of
Type A contact-less cards.
The P2 field of the ISO7816_VALUE_BLOCK Byte APDU contains Value parameters like Value
Increment, Value decrement.
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 18 of 36
SCR331-DI Product Technical Manual
4.5.7 Detailed description of the APDU set
4.5.7.1 Memory card APDU Set
4.5.7.1.1 ISO7816_READ_BINARY
Description
This APDU reads block, which is specified as a P1 parameter. This APDU reads block size based on
Type A memory card types like Mifare 1K and 4K cards block size are 0x10 bytes and Mifare Ultra
light card size is 0x04 bytes.
Format
Command CLA INS P1 P2 P3
ISO7816_READ_BINARY
0xFC
0xB0
Block No. RFU 0x00
Explanation of the Parameters
Field Value Meaning
P1 Block number This indicates the which block to be read
Response
Data
Block value
Status Words
SW1 SW2 Description
90 00
On success, NO ERROR, else error code is returned, see status words table
N
ote
Return data is based on contact-less card types. This command returns 16 bytes for Mifare 1K/4K
and 4 bytes for Mifare Ultra light cards.
Example
To read block no. 5,
CLA INS P1 P2 P3
0xFC 0xB0 0x05 0x00 0x00
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 19 of 36
SCR331-DI Product Technical Manual
4.5.7.1.2 ISO7816_WRITE_BINARY
Description
This APDU writes data pattern in to corresponding block number which is specified as a P1 parameter
in APDU command set. Based on Memory card size, P3 bytes are varied. If Memory card is Mifare
1K/4K type, then P3 length is 0x10 bytes otherwise P3 length is 0x04.
Format
Command CLA INS P1 P2 P3 Data
ISO7816_WRITE_BINARY
0xFC
0xD0
Block No. RFU Lc len Lc bytes
Explanation of the Parameters
Field Value Meaning
P1 Block number This indicates the which block to be written
Response
Data
None
Status Words
SW1 SW2 Description
90 00
On success, NO ERROR, else error code is returned, see status words table
Example
To write block no. 5,
CLA INS P1 P2 P3 Data
0xFC 0xD0 0x05 0x00 0x10 0x01 0x02 0x03 … 0x10
IND.SCR331-DI.MANUAL.VER.1.8 VER1.8 Page 20 of 36
/