Manual SDI010
Manual SDI010
SDI010
Dual interface (contactless and contact) stationary reader
Reference manual
SDI010 Dual Interface (Contactless and Contact)
Stationary Reader
© SCM Microsystems
Oskar-Messter-Strasse, 13
85737 Ismaning
Germany
Phone +49 89 9595 5000 • Fax +49 89 9595 5555
Document history
Date Version Description of change
13/04/2009 1.14 Major changes to earlier versions. Inline with the new manual
templates.
Contact information
http://www.scmmicro.com/products-services/smart-card-readers-terminals/contactless-dual-
interface-readers.html
For sales information, please email [email protected]
Table of Contents
1. Legal information ............................................................................................................... 9
1.1. Disclaimers..................................................................................................................... 9
1.2. Licenses ......................................................................................................................... 9
1.3. Trademarks .................................................................................................................... 9
1. Legal information
1.1. Disclaimers
The content published in this document is believed to be accurate. SCM Microsystems does
not, however, provide any representation or warranty regarding the accuracy or completeness
of its content and regarding the consequences of the use of information contained herein. If this
document has the status “Draft”, its content is still under internal review and yet to be formally
validated.
SCM Microsystems reserves the right to change the content of this document without prior
notice. The content of this document supersedes the content of previous versions of the same
document. The document may contain application descriptions and/or source code examples,
which are for illustrative purposes only. SCM Microsystems gives no representation or warranty
that such descriptions or examples are suitable for the application that the reader may want to
use them for.
Should you notice problems with the provided documentation, please provide your feedback to
[email protected].
1.2. Licenses
If the document contains source code examples, they are provided for illustrative purposes only
and subject to the following restrictions:
• You MAY at your own risk use or modify the source code provided in the document
in applications you may develop. You MAY distribute those applications ONLY in
form of compiled applications.
• You MAY NOT copy or distribute parts of or the entire source code without prior
written consent from SCM Microsystems.
• You MAY NOT combine or distribute the source code provided with Open Source
Software or with software developed using Open Source Software in a manner that
subjects the source code or any portion thereof to any license obligations of such
Open Source Software.
If the document contains technical drawings related to SCM Microsystems products, they are
provided for documentation purposes only. SCM Microsystems does not grant you any license
to its designs.
1.3. Trademarks
MIFARE is a registered trademark of NXP Semiconductors BV.
Windows is a trademark of Microsoft Corporation.
SDI010 REFERENCE MANUAL 10
2.5. References
Doc ref in Description Issuer
the manual
ISO/IEC 7816- Identification cards — Integrated circuit ISO / IEC
3 cards — Part 3: Cards with contacts — Electrical
interface and transmission protocols
ISO/IEC 7816- Identification cards - Integrated circuit(s) cards with ISO / IEC
4 contacts
Part 4: Interindustry commands for interchange
ISO/IEC 7816-4: 1995 (E)
ISO/IEC Identification cards — Contactless ISO / IEC
14443-3 integrated circuit(s) cards — Proximity
cards — Part 3: Initialization and anticollision
ISO/IEC Identification cards — Contactless integrated ISO / IEC
14443-4 circuit(s) cards — Proximity cards
Part 4: Transmission protocol ISO/IEC 14443-
4:2001(E)
PC/SC Interoperability Specification for ICCs and Personal PC/SC Workgroup
Computer Systems v2.01
CCID Specification for Integrated Circuit(s) Cards USB-IF
Interface Devices 1.1
USB Universal Serial Bus Specification 2.0 USB-IF
SDI010 REFERENCE MANUAL 13
2.6. Conventions
Bits are represented by lower case ‘b’ where followed by a numbering digit.
Bytes are represented by upper case ‘B’ where followed by a numbering digit.
Example:
163 decimal number is represented
• in hexadecimal as 0xA3
• in binary as (10100011)b
The least significant nibble of 0xA3 is
• 0x3 in hexadecimal
• (0011)b in binary
The most significant nibble of =xA3 is
• 0xA in hexadecimal
• (1010)b in binary
SDI010 REFERENCE MANUAL 14
• Unique serial number which enables that SDI010 can be plugged into any USB slot
on a PC without having to re-install the driver.
SDI010 REFERENCE MANUAL 15
SDI010 904671
• The logo
Terms and conditions apply, please contact your local SCM representative or send an email to
[email protected].
SDI010 REFERENCE MANUAL 16
0
Key fob
I01
SD
• NFC mobile phone etc…
Communication between SDI010 and user SDI010
tokens uses magnetic field inductive
coupling.
The magnetic field generated by SDI010 has a carrier frequency of 13.56MHz.
1
In the ISO/IEC 14443 standard, the reader is called the proximity coupling device (PCD)
2
In the ISO/IEC 14443 standard, the user token is called proximity integrated chip card (PICC)
SDI010 REFERENCE MANUAL 17
3.5.3. Recommendations
The communication between the reader and the user token is sensitive to the presence of
material or objects interfering with the magnetic field generated by the reader.
The presence of conductive materials like metal in the vicinity of the reader and the user token
can severally degrade the communication and even make it impossible. The magnetic field of
the reader generates Eddy or Foucault’s currents in the conductive materials; the field is
literally absorbed by that kind of material.
The presence of multiple user tokens in the field also interferes with the communication. When
several user tokens are in the field of the reader, load of the field increases which implies that
less energy is available for each of them and that the system is detuned. For this reason, SCM
Microsystems has implemented in its driver only 1 slot by default. This means that in the event
several user tokens are in the field of the SDI010, only one will be active. It is possible using
INF configuration to enable up to 4 slots – i.e. to activate up to 4 user tokens nevertheless the
depending on the power consumption of the user tokens communication cannot be guarantied.
Please note that multiple contactless slots feature is supported but is kept disabled by default.
The SDI010 driver on configuration allows the presence and use of several PICCs (maximum 4) at
the same time. The driver can support multiple logical connections and present each of them as a
slot logical device to the Resource Manager and higher components. Also the simultaneous working
of multiple Contactless cards is not guaranteed and depends on the antenna size and the power
requirements of the card.
The communication between the reader and the user token is sensitive to the geometry of the
system {reader, user token}. Parameters like the geometry and specially the relative size of the
reader and user token antennas directly influence the inductive coupling and therefore the
communication.
SDI010 was primarily designed and optimized to function with user credentials of various
technologies having the size of a credit card.
In order to optimize the coupling between the reader and the user token, it is
recommended to put both antennas as parallel as possible
In order to optimize transaction speed between the reader and the card it is
recommended to place the user token as close as possible to the reader. This
will increase the amount of energy supplied to the user credential which will
then be able to use its microprocessor at higher speeds
SDI010 REFERENCE MANUAL 18
3.6. Applications
3.6.1. General
SDI010 is a transparent reader designed to interface a personal computer host supporting
PC/SC interface with 13.56MHz user tokens like public transport cards, contactless banking
cards, electronic identification documents – e.g. e-passports, e-ID cards, driving licenses etc.
Those user tokens can have several form factors like credit cards, key fobs, NFC mobile
phones or USB dongles like SCT3511 that SCM Microsystems markets.
0
I01
SD
SDI010 itself handles the communication protocol but not the application related to the token.
The application-specific logic has to be implemented by software developers on the host.
• The NFC forum tag reader/writer is a standalone application that enables the user to
read and write NFC forum compliant records into NFC forum compatible tags. It is an
easy to use tool to configure rapidly NFC forum tag demonstrations. Note: SDI010
supports NFC forum tag type 2 and 4, only.
• Smart card commander version 1.1 provides NFC forum record parsing functionality
of NDEF records in XML format as well as scripting functionality which can be very
useful for developers to develop and debug their applications. This tool can be used
for both the contact and the contactless interfaces of SDI010.
SDI010 REFERENCE MANUAL 19
4. SDI010 characteristics
4.1. SDI010 high level architecture
S010 has a device controller which is SCM’s STCII ASIC. This ASIC has several interfaces
available. In SDI010 implementation 2 peripherals are connected to the device controller:
The SDI010 driver implements PC/SC v2.0 API towards upper layers and uses SCM firmware
commands encapsulated in CCID-like protocol for the contactless slot and full CCID for the
contact slot.
The SDI010 contactless driver handles all the contactless-related intelligence – i.e. ISO/IEC
14443 and the SDI010 firmware handles the raw transport of data to and from the contactless
cards.
SDI010 REFERENCE MANUAL 21
SDI010
Default label
Drawing with dimensions of the SDI010 and accessories can be found in annex.
SDI010 REFERENCE MANUAL 22
3
A combi card is a smart card which has both a contact and a contactless interface. Some of those cards have one
controller with two interfaces. Data can be accessed through the contact or the contactless interface. For those when
the contact interface is powered up the contactless interface is disabled. There are nevertheless in the market combi
cards with 1 contact chip and 1 contactless chip. Those cards can be seen at the same time as a contact and a
contactless card when inserted in the contact interface of SDI010.
SDI010 REFERENCE MANUAL 23
4.2.3.1. General
Parameter Value/Description
Clock of the device
24 MHz
controller
API PC/SC 2.0
Operating temperature
0º to 50ºC
range
Operating humidity
Up to 95%RH non condensing
range
USB
CE
FCC
Certifications VCCI
WEEE
RoHS
WHQL
4.2.3.2. USB
Parameter Value/Description
High bus powered (SDI010 draws power from USB bus)
Voltage: 5V
DC characteristics
Max. Current : 200mA
Suspend current : 380uA
USB specification USB 2.0 FS Device
USB Speed Full Speed Device (12Mbit/s)
Device Class Vendor
PID 0x5121
VID 0x04E6
SDI010 REFERENCE MANUAL 24
5. Software modules
5.1. Installation
SCM provides an installer for Windows.
The installer can be used to install the driver as well as some utilities.
5.2. Utilities
The following utilities are available:
• A tool called PC/SC Diag capable of providing basic information about the reader
and a card through PC/SC stack
The DFU utility comes with a specific driver for dynamic Device Firmware Upgrade (DFU)
through the USB interface.
Operating systems supported by DFU tool:
• Windows 98
• Windows ME
• Windows 2000
• Windows 2003 Server (32 & 64 bit)
5.3. Driver
• SCM Microsystems Inc. SDI010 Smart Card Reader for the contact reader
• SCM Microsystems Inc. SDI010 Contactless Reader for the contactless reader
SDI010 REFERENCE MANUAL 26
• Windows 98
• Windows ME
• Windows 2000
• Windows 2003 Server (32 & 64 bit)
5.4. Firmware
• 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
• HW_ERROR
• XFR_PARITY_ERROR
SDI010 REFERENCE MANUAL 30
• BAD_ATR_TS
• BAD_ATR_TCK
• ICC_MUTE
The following sub-sections discuss when and why these error codes are returned:
5.4.1.3.1. HW_ERROR
This error code is returned when a hardware short circuit condition is detected, during
application of power to the card or if any other internal hardware error is detected. This error
code has been defined in the error code table 6.2-2 of the CCID specification.
5.4.1.3.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 6.2-2 of the CCID specification.
5.4.1.3.3. 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
6.2-2 of the CCID specification.
6. Commands description
6.1. Generic APDU
6.1.1.1. Description
GET UID will retrieve the UID or SNR or PUPI of the user token. This command can be used
for all supported technologies.
6.1.1.2. Format
CLA INS P1 P2 Lc Data in Le
0xFF 0xCA 0x00 0x00 - - XX
Setting Le = 0x00 can be used to request the full UID or PUPI is sent back.(e.g. for ISO14443A
single 4 bytes, double 7 bytes, triple 10 bytes, for ISO14443B 4 bytes PUPI).
6.1.1.3. Response
Data Out
UID + SW1 + SW2
6.1.1.5. Examples
ISO14443-4A
ISO14443-4B
MIFARE 4K
MIFARE Ultralight
SDI010 REFERENCE MANUAL 33
6.1.2.1. Description
This command can be used to send escape commands to SDI010. For description of escape
commands please refer to the dedicated chapter in this manual.
6.1.2.2. Format
CLA INS P1 P2 P3 Data in
0xFF 0xCC 0x00 0x00 Lc Input buffer of escape command
Lc is the length of the escape command’s input buffer. See escape commands description later
in this manual
6.1.2.3. Response
Output buffer of the escape command
6.1.2.4. Example
To get the ATS or ATQB of the ISO14443-4 based user token, you can use this APDU to send
the READER_CNTLESS_GET_ATS_ATQB (0x93) escape command
Type A passport
Type B passport
To get the reader status about support of 848Kbps, you can use this APDU to send the
READER_CNTLESS_848KBPS (0x9D) escape command.
By default the SDI010 doesn’t have 848Kbps enabled on its contactless interface, the following
sequence
• Enables 848Kbps
• Checks the status again and the answer 0x01 indicates 848Kbps is enabled
SDI010 REFERENCE MANUAL 34
6.2.1. STORAGE_CARD_CMDS_READ_BINARY
6.2.1.1. Description
Using this APDU, application can read a memory block on user tokens based on technologies
like MIFARE Classic 1K or 4K (block size 0x10 bytes) or MIFARE Ultra light (block size 0x04
bytes).
6.2.1.2. Format
CLA INS P1 P2 Le
0xFF 0xB0 Address Address 0xXX
MSB LSB
Where:
6.2.1.3. Response
Data Out
Data + SW1 + SW2
6.2.1.5. Example
For a MIFARE Classic 1K card which has the following memory content:
To read the seventh block, you have to issue the following command and get the following
response:
SDI010 REFERENCE MANUAL 36
6.2.2. STORAGE_CARD_CMDS_WRITE_BINARY
6.2.2.1. Description
This APDU writes data pattern in to a memory address
6.2.2.2. Format
CLA INS P1 P2 Lc Data in
0xFF 0xD6 Address Address 0xXX Data
MSB LSB
Where:
6.2.2.3. Response
Data Out
SW1 + SW2
6.2.2.5. Example
For a MIFARE Classic Ultralight card which has the following memory content:
Issuing the command
SDI010 REFERENCE MANUAL 37
6.2.3. STORAGE_CARD_CMDS_LOAD_KEYS
6.2.3.1. Description
Some type of user tokens like MIFARE Classic may require that an authentication happens
before any data can be read or written. To perform this authentication, keys need to be loaded
in the reader’s memory using this command.
6.2.3.2. Format
CLA INS P1 P2 Lc Data in
0xFF 0x82 0x00 Key Type Key Length Key value
Where P2 can have the following values (please refer to MIFARE documentation from NXP for
further details on what is key A and Key B):
6.2.3.3. Response
Data Out
SW1 + SW2
6.2.4. STORAGE_CARD_CMDS_AUTHENTICATE
6.2.4.1. Description
This command enables to perform authentication for user tokens based on MIFARE Classic 1K
or 4K. Before this command can be successfully executed, the
STORAGE_CARD_CMDS_LOAD_KEY command must have been executed.
6.2.4.2. Format
CLA INS P1 P2 Lc Data in
0xFF 0x86 0x00 0x00 0x05 Data
Where the data field is structured as follow
6.2.4.3. Response
Data Out
SW1 + SW2
6.2.4.5. Example
For a MIFARE Classic 1K card which has the following memory mapping:
Reading sector 0 or sector 1 of this card requires authentication with key A or key B.
The following example:
• reads block #6
• reads block #E
SDI010 REFERENCE MANUAL 41
6.2.5. STORAGE_CARD_CMDS_VALUE_BLOCK
6.2.5.1. Description
This APDU is used to interact with MIFARE Classic e-purse applications. Please refer to
MIFARE Classic documentation available from NXP Semiconductors for further details on
MIFARE classic memory mapping and commands.
6.2.5.2. Format
CLA INS P1 P2 Lc Data in
0xFF 0xF0 0x00 Block# Lc Data
Where P2 code the address of the block number addressed
Where the data field is structured as follow
Byte # Value Description
B0 0xC0 Increment
0xC1 Decrement
B1 Block number
B2-B5 Value (LSB first)
6.2.5.3. Response
Data Out
SW1 + SW2
6.2.5.5. Example
CLA INS P1 P2 Lc Data in
0xFF 0xF0 0x00 0x1E 0x06 0xC0 0x1E 0x01 0x00 0x00 0x00
The above APDU will increment the value in block number 0x1E of a MIFARE Classic-based
user token by a value of 0x01.
SDI010 REFERENCE MANUAL 42
Description
SDI010 can transfer directly ISO/IEC7816-4 APDU to the PICC.
SDI010 supports user tokens that have both the MIFARE and T=CL partitions. Depending on
the APDU sent by the host, the reader switches to the corresponding mode (MIFARE or T=CL)
automatically and the command is processed accordingly.
6.3.1.1. Format
CLA INS P1 P2 P3 Data
6.3.1.2. Response
Data Out
PICC answer as defined in ISO/IEC 7816-4+ SW1 + SW2
As defined in ISO/IEC 7816-4.
6.3.1.4. Example
The following APDU sequence reads the first 256 bytes of the data group 1 as specified in
ICAO LDS (logical data structure) for machine readable travel documents with open access. It
first selects the issuer application using its AID (0xA0 0x00 0x00 0x02 0x47 0x10 0x01), then
selects the DG1 file (0x01 0x01) and then does a read binary.
SDI010 REFERENCE MANUAL 43
Description
This command can be used to send raw data to the user token.
6.3.2.1. Format
CLA INS P1 P2 P3 Data
0xFF 0xFE 0x00 0x00 Lraw_data Raw_data
6.3.2.2. Response
Data Out
PICC response data+ SW1 + SW2
User should refer to the status words defined by the PICC manufacturer for a description of the
status words
6.3.2.4. Example
Let’s consider the Select command defined in ISO7816-4. This command being ISO can be
sent to the user token in 2 different way:
The T=CL command is nevertheless more useful for sending commands which are not defined
in ISO7816.
SDI010 REFERENCE MANUAL 44
Description
This command can be used to send commands to DESFire-based user tokens.
For a description of DESFire commands please contact NXP Semiconductors.
6.4.1.1. Format
CLA INS P1 P2 P3 Data
0xFF 0xDE 0x00 0x00 Lcommand Command
Response
Data Out
DESFire response data+ 9000 if the DESFire response data is of single byte
DESFire response data if the DESFire response data is more than 1 byte
SDI010 REFERENCE MANUAL 45
6.5.3. READER_GETCARDINFO
This escape command is used to get information about the card placed on the reader. The
SDI010 returns an error if no card is placed on it.
The input buffer shall contain the escape command code
Input buffer
0x11
The output buffer contents are described below.
Output buffer Value Description
B0 0x01 Contactless card present
B1 0xNN Baud rate of card-reader communication
B2 0xXY X – Upper nibble indicates 0 - memory card
1 - T=CL card
2 - Dual mode card
Y – Lower nibble indicates 0 - Type A card
1 - Type B card
The Baud rate of card-reader communication 0xNN shall indicate a BYTE as follows
B8 B7 B6 B5 B4 B3 B2 B1
0
For Example:
If 0xNN = 0x77, the card supports all baud rates namely 106, 212, 424 and 848 kbps in both
directions. This card can be forced to work at different baud rates in the send and receive
directions using the escape command
READER_CNTLESS_FORCE_BAUDRATE_PCSC_REV2.
If 0xNN = 0xB3, the card supports 106, 212 and 424 kbps in both directions. This card can be
made to work only at the same baud rate in the send and receive directions using the escape
command READER_CNTLESS_FORCE_BAUDRATE_PCSC_REV2.
SDI010 REFERENCE MANUAL 47
6.5.4. READER_LED_CONTROL_BY_FW
This escape command may be used to enable or disable LED control by the firmware.
The input buffer is
Byte # Value Description
B0 0xB2 Escape command code
B1 0x00 Disable LED control by FW
0x01 Enable LED control by FW
The output buffer is
Output buffer
NULL
6.5.5. READER_LEDCONTROL
This escape command is used to turn ON/OFF the LED.
This escape command shall work only if LED control by firmware is disabled.
The input buffer shall contain 3 bytes
Byte # Value Description
B0 0x19 Escape command code
B1 0x00 LED number
B2 0x00 LED ON
0x01 LED OFF
The output buffer is
Output buffer
NULL
6.5.6. READER_CNTLESS_GET_MFRC_REV
This escape message retrieves the revision number of the RF ASIC MFRC531.
The input buffer contains the escape command code
Input buffer
0x92
6.5.7. READER_CNTLESS_GET_ATS_ATQB
This escape command enables the host to retrieve the ATS for Type A T= CL or the ATQB for
Type B cards.
The input buffer contains the escape command code
Input buffer
0x93
The output buffer contains the ATS bytes or the ATQB bytes depending on the type of PICC
placed on the reader.
6.5.8. READER_CNTLESS_GET_TYPE
This escape command retrieves the type of the card which SDI010 is configured to poll for.
The input buffer shall contain the escape command code
Input buffer
0x94
The output buffer shall point to a BYTE buffer which will contain the type value coded as
Value Description
0x00 Type A
0x01 Type B
0x02 Type A + type B
6.5.9. READER_CNTLESS_SET_TYPE
This escape command configures the type of cards SDI010 will poll for.
Using this command can improve the polling efficiency of SDI010 for applications where only
type A or only type B cards are expected.
The default is Type A + type B (0x02).
The input buffer shall contain 2 bytes
Byte # Value Description
B0 0x95 Escape command code
B1 0x00 Type A
0x01 Type B
0x02 Type A + type B
The output buffer is
Output buffer
NULL
SDI010 REFERENCE MANUAL 49
6.5.10. READER_CNTLESS_RF_SWITCH
This escape command can be used to retrieve/set the RF state of SDI010.
The default RF field state is ON.
The input buffer shall contain 2 bytes
Byte # Value Description
B0 0x96 Escape command code
B1 0x00 Switch RF Field OFF
0x01 Switch RF Field ON
0xFF Get current field state
After the RF is turned off, to turn the RF ON again, card connect shall be done in direct mode.
If B1 of the input buffer is 0x00 or 0x01 the output buffer is
Output buffer
NULL
If B1 of the input buffer is 0xFF, the output buffer is a BYTE buffer with 2 possible values
Output buffer Description
0x01 RF field is OFF
0x00 RF field is ON
6.5.11. READER_CNTLESS_RAW_CFG
This escape command switches SDI010 to raw mode.
When SDI010 is in raw mode it only polls for one type of contactless card.
SDI010 is by default not in this mode and therefore READER_CNTLESS_RAW_XMIT_EX
would fail.
The input buffer contains 2 bytes
Byte # Value Description
B0 0x97 Escape Function code
B1 0x00 Type A will be use for further
transmissions in raw mode
0x01 Type B will be use for further
transmissions in raw mode
The output buffer is
Output buffer
NULL
6.5.12. READER_CNTLESS_RAW_XMIT_EX
This escape command can only be executed by the firmware once SDI010 is put in raw mode
using the READER_CNTLESS_RAW_CFG escape command.
This escape command can be used to send commands to smart card when SDI010 is in raw
mode
The input buffer is
Byte # Value Description
B0 0xAE Escape Function code
B1 Wait Time
B2 Is CRC required?
B3 No of bits per command
B4 Card Type
0 – Type A
1 – type B
B5 Command length
B6 - Bn Command
The output buffer contains the response to the command from the offset B6 onwards.
The following example uses the raw mode to send a REQB command
First, we have to switch the SDI010 into raw mode for type B communication
Byte # Value Description
B0 0x97 READER_CNTLESS_RAW_CONFIG code
B1 0x01 Type B will be used
Then, we can send the following bytes to obtain the ATQB response of any type B user token in
the field
Byte # Value Description
B0 0xAE READER_CNTLESS_RAW_XMIT_EX code
B1 0x03 FWI is set to 3
B2 0x01 Enable CRC (CRC will be calculated by the
RF front end of SDI010)
B3 0x00 Number of bits to be sent in the command
0 – Entire byte will be sent
B4 0x01 Type B
B5 0x03 Command length in bytes
B6 0x05 REQB command’s anticollision prefix byte
B7 0x00 REQB command’s application family
identifier
B8 0x01 REQB command parameter with slot number
set as 1
SDI010 REFERENCE MANUAL 51
6.5.14. READER_SWITCH_RF_ON_OFF
This escape command can be used to switch the RF field ON or OFF when a Contact smart
card is inserted into the reader.
By default, the RF field is always in the ON state and when any contact smart card is inserted
in the reader, the RF field is turned OFF.
The input buffer shall contain 2 bytes
Byte # Value Description
B0 0x9C Escape command code
B1 0x00 Switch RF Field OFF when contact card
is present in the reader
0x01 Switch RF Field ON when contact card
is present in the reader
0xFF Get current field state when Contact
smart card is present in the reader
After the RF is turned off, to turn the RF ON again, card connect shall be done in direct mode.
SDI010 REFERENCE MANUAL 52
6.5.15. READER_CNTLESS_848KBPS
This escape command can be used to enable/disable 848kbps support by SDI010 as well as
query whether 848kbps is currently enabled or disabled by SDI010.
The RF communication with a user token will only switch to 848Kbps provided the user token
supports this baud rate and provided automatic PPS is ON.
The input buffer shall contain 2 bytes
Byte # Value Description
B0 0x9D Escape command code
B1 0x00 Disable 848Kbps support
0x01 Enable 848Kbps support
0xFF Get current status on 848Kbps support
If B1 of the input buffer is 0x00 or 0x01 then the output buffer is
Output buffer
NULL
If B1 of the input buffer is 0xFF, the output buffer is a BYTE buffer with following possible
values
Output buffer Description
0x00 848Kbps is disabled
0x01 848Kbps is enabled
SDI010 REFERENCE MANUAL 53
6.5.16. READER_CNTLESS_BAUDRATE
This escape command can be used to get the actual operating baud rate of card-reader
communication.
The input buffer shall contain the escape message value.
Input buffer
0x9E
The output buffer shall point to a BYTE buffer with following possible values
Output buffer Description
0x00 106Kbps in both directions
0x01 106Kbps from PICC to PCD, 212Kbps from PCD to PICC
0x02 106Kbps from PICC to PCD, 424Kbps from PCD to PICC
0x03 106Kbps from PICC to PCD, 848Kbps from PCD to PICC
0x10 212Kbps from PICC to PCD, 106Kbps from PCD to PICC
0x11 212Kbps in both directions
0x12 212Kbps from PICC to PCD, 424Kbps from PCD to PICC
0x13 212Kbps from PICC to PCD, 848Kbps from PCD to PICC
0x20 424Kbps from PICC to PCD, 106Kbps from PCD to PICC
0x21 424Kbps from PICC to PCD, 212Kbps from PCD to PICC
0x22 424Kbps in both directions
0x23 424Kbps from PICC to PCD, 848Kbps from PCD to PICC
0x30 848Kbps from PICC to PCD, 106Kbps from PCD to PICC
0x31 848Kbps from PICC to PCD, 212Kbps from PCD to PICC
0x32 848Kbps from PICC to PCD, 424Kbps from PCD to PICC
0x33 848Kbps in both directions
SDI010 REFERENCE MANUAL 54
6.5.17. READER_CNTLESS_FORCE_BAUDRATE_PCSC_REV2
This escape command can be used to force baud rate for Contactless cards.
The input buffer is
Byte # Value Description
B0 0xAD Escape command code
B1 0x00 Apply the baud rate specified by the card
B2 b0- DR=2 supported, if bit is set to 1 Encoding of the baud rate to be forced if
B1 value is 0x01. No need to send this
b1- DR=4 supported, if bit is set to 1
byte in case B1 has the value =x00
b2- DR=8 supported, if bit is set to 1
b3- shall be set to 0, 1 is RFU
b4- DS=2 supported, if bit is set to 1
b5- DS=4 supported, if bit is set to 1
b6- DS=8 supported, if bit is set to 1
b7- 1 if the same D is required for
both communication directions
b8- 0 if different D is supported for
each communication direction
NULL If B1=0x00
The output buffer is
Output buffer
NULL
SDI010 REFERENCE MANUAL 55
6.6.3. READER_SETMODE
This escape command may be used to set the mode of the reader. Applications may call this
function, to set the desired mode. Typically, this call is used to switch between the EMV,
ISO7816 and the memory card modes of operation.
6.6.4. READER_GETMODE
This escape command may be used to retrieve the current mode of the reader.
6.6.5. READER_APDU_TRANSFER
This escape command may be used to exchange an APDU with the smart card.
The maximum number of bytes that can be transmitted and received is given below.
Transmit:
Case 1,2,3 APDU: Max of 256 bytes per APDU
Case 4 APDU: Max of 255 bytes per APDU
Receive:
Max of 259 bytes per APDU
SDI010 REFERENCE MANUAL 57
6.6.6. READER_SWITCH_SPEED
In case, when the application is capable of switching the card’s speed through APDU (if the
card supports such a feature), this escape command is used to inform the reader about the
speed change occurred between application and card. The first byte will contain the escape
function value; the next two bytes contain Fi and Di respectively. The output buffer field shall be
NULL.
The input buffer is
Byte # Value Description
B0 0x0A Escape command code
B1 Fi value
B2 Di value
6.6.7. READER_SWITCH_PROTOCOL
In case, when the application is capable of switching the card’s protocol through APDU (if the
card support such a feature), this escape command is used to inform the reader about the
protocol change occurred between application and card.
6.6.8. READER_DISABLE_PPS
This escape command disables the automatic PPS done by the firmware.
6.6.9. READER_GETIFDTYPE
This escape command is used to get the current IFD type from the reader. The first byte of the
input buffer contains the escape id value. The reader gets the value from the reader capability
structure, which is implemented in the reader as a configurable item. The output buffer shall
point to a WORD buffer. The IFD type of SDI010-Generic is 0x010E,
6.6.10. READER_GETINFO_EXTENDED
This escape command is used to get the information of the reader like the major and minor
version of the firmware, capabilities of the reader and the Unicode serial number. The output
buffer shall point to an application allocated SCARD_READER_GETINFO_PARAMS_EX
structure mentioned below.
7. Annexes
7.1. Annex A – Status words table
SW1 SW2 Description
0x90 0x00 NO ERROR
0x67 0x00 LENGTH INCORRECT
0x6D 0x00 INVALID INSTRUCTION BYTE
0x6E 0x00 CLASS NOT SUPPORTED
0x6F 0x00 UNKNOWN COMMAND
0x63 0x00 NO INFORMATION GIVEN
0x65 0x81 MEMORY FAILURE
0x68 0x00 CLASS BYTE INCORRECT
0x6A 0x81 FUNCTION NOT SUPPORTED
0x6B 0x00 WRONG PARAMETER P1-P2
SDI010 REFERENCE MANUAL 61
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#include <windows.h>
#include <winbase.h>
#include <stdio.h>
#include <conio.h>
#include "winscard.h"
#include "winerror.h"
#include "T_hbr.H"
VOID main(VOID)
{
SCARDCONTEXT ContextHandle;
SCARDHANDLE CardHandle;
BYTE OutByte;
WORD InWord,i;
DWORD ActiveProtocol; /* ICC protocol */
ULONG InBufLen,ResLen;
ULONG ret;
SDI010 REFERENCE MANUAL 62
SCARD_READERSTATE Reader[1];
// please add the name of the used reader here or use SCardListReaders
// to find the right reader name
char *ReaderName[] = {"SCM Microsystems Inc. SDI010 Contactless Reader 0",
NULL};
/***************************************************************************************
*****************/
ContextHandle = -1;
if (ret == SCARD_S_SUCCESS)
{
ret = SCardConnect( ContextHandle,
ReaderName[0],
SCARD_SHARE_SHARED,
SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1,
&CardHandle,
&ActiveProtocol);
if (ret == SCARD_S_SUCCESS)
{
/* get actual 848kbps status: ON/OFF */
InBufLen = 2;
InWord = CCID_GET_848KBPS_STATUS;
ret = SCardControl (CardHandle,
IOCTL_CCID_ESCAPE,
&InWord,
InBufLen,
&OutByte,
1,
&ResLen);
Reader[0].dwCurrentState = SCARD_STATE_UNAWARE;
Reader[0].dwEventState = SCARD_STATE_UNAWARE;
Reader[0].szReader = ReaderName[0];
MINTIMEOUT,
Reader,
1);
/* enable 848KBPS: ON */
InBufLen = 2;
InWord = CCID_GET_848KBPS_STATUS;
ret = SCardControl (CardHandle,
IOCTL_CCID_ESCAPE,
&InWord,
InBufLen,
&OutByte,
1,
&ResLen);
SDI010 REFERENCE MANUAL 64
Reader[0].dwCurrentState = SCARD_STATE_UNAWARE;
Reader[0].dwEventState = SCARD_STATE_UNAWARE;
Reader[0].szReader = ReaderName[0];
Reader[0].dwCurrentState = SCARD_STATE_UNAWARE;
Reader[0].dwEventState = SCARD_STATE_UNAWARE;
SDI010 REFERENCE MANUAL 65
Reader[0].szReader = ReaderName[0];
ret = SCardGetStatusChange(ContextHandle, MINTIMEOUT, Reader, 1);
printf ("\nATR: ");
for (i=0; i<Reader->cbAtr; i++)
{
printf ("%.2x ",Reader->rgbAtr[i]);
}
printf ("\n----------------------------------------------\n");
The second SCM Proprietary APDU is blocked for the application layer. This is used for internal
communication i.e. between the driver and the firmware.
In order to maintain compatibility with some customer applications which use the CLA bytes of
PC/SC 1.0 architecture, the following switching mechanism can be used.
7.4.3. Stand