Documents

49 pages
322 views

API-ACR122U-2.04.pdf

of 49
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Share
Description
ACR122U USB NFC Reader Application Programming Interface V2.04 Subject to change without prior notice info@acs.com.hk www.acs.com.hk Table of Contents 1.0. Introduction ............................................................................................................. 4 1.1. Features .......................................................................................................
Transcript
    Subject to change without prior notice   info@acs.com.hk   www.acs.com.hk    Application Programming Interface V2.04  ACR122U USB NFC Reader     ACR122U – Application Programming Interface  info@acs.com.hk Version 2.04 www.acs.com.hk Page 2 of 49  Table of Contents 1.0.   Introduction ............................................................................................................. 4   1.1.   Features ................................................................................................................................. 4   1.2.   USB Interface ........................................................................................................................ 5   2.0.   Implementation ........................................................................................................ 6   2.1.   Communication Flow Chart of ACR122U .............................................................................. 6   2.2.   Smart Card Reader Interface Overview ................................................................................ 7   3.0.   PICC Interface Description ..................................................................................... 8   3.1.    ATR Generation ..................................................................................................................... 8   3.1.1.    ATR format for ISO 14443 Part 3 PICCs ...................................................................... 8   3.1.2.    ATR format for ISO 14443 Part 4 PICCs ...................................................................... 9   4.0.   PICC Commands for General Purposes .............................................................. 11   4.1.   Get Data............................................................................................................................... 11   5.0.   PICC Commands (T=CL Emulation) for MIFARE Classic Memory Cards .......... 12   5.1.   Load Authentication Keys .................................................................................................... 12   5.2.    Authentication ...................................................................................................................... 13   5.3.   Read Binary Blocks ............................................................................................................. 16   5.4.   Update Binary Blocks .......................................................................................................... 17   5.5.   Value Block Related Commands ......................................................................................... 18   5.5.1.   Value Block Operation ................................................................................................ 18   5.5.2.   Read Value Block ........................................................................................................ 19   5.5.3.   Restore Value Block.................................................................................................... 20   6.0.   Pseudo-APDU Commands .................................................................................... 21   6.1.   Direct Transmit .................................................................................................................... 21   6.2.   Bi-color LED and Buzzer Control ......................................................................................... 22   6.3.   Get firmware version of the reader ...................................................................................... 24   6.4.   Get the PICC operating parameter ...................................................................................... 25   6.5.   Set the PICC operating parameter ...................................................................................... 26   6.6.   Set Timeout Parameter ........................................................................................................ 27   6.7.   Set buzzer output during card detection .............................................................................. 28   7.0.   Basic Program Flow for Contactless Applications ............................................. 29   7.1.   How to access PC/SC-compliant tags (ISO 14443-4)? ....................................................... 31   7.2.   How to access MIFARE DESFire tags (ISO 14443-4)? ...................................................... 32   7.3.   How to access FeliCa tags (ISO 18092)? ........................................................................... 34   7.4.   How to access NFC Forum Type 1 Tags (ISO 18092)? ...................................................... 35   7.5.   Get the current setting of the contactless interface ............................................................. 37    Appendix A.    ACR122U PC/SC Escape Command ........................................................ 38    Appendix B.    APDU Command and Response Flow for ISO 14443-Compliant Tags .. 41    Appendix C.    APDU command and response flow for ISO 18092–compliant tags ..... 42    Appendix D.   Error Codes ............................................................................................... 43    Appendix E.   Sample codes for setting the LED ........................................................... 45   List of Figures Figure 1  : Communication Flow Chart of ACR122U .............................................................................. 6   Figure 2  : Smart Card Reader Interface on the Device Manager .......................................................... 7       ACR122U – Application Programming Interface  info@acs.com.hk Version 2.04 www.acs.com.hk Page 3 of 49  Figure 3  : Basic Program Flow for Contactless Applications ............................................................... 29   Figure 4  : Topaz Memory Map ............................................................................................................. 36   List of Tables Table 1  : USB Interface .......................................................................................................................... 5   Table 2  : ATR format for ISO 14443 Part 3 PICCs ................................................................................. 8   Table 3  : ATR format for ISO 14443 Part 4 PICCs ................................................................................. 9   Table 4  : MIFARE 1K Memory Map ...................................................................................................... 14   Table 5  : MIFARE Classic 4K Memory Map ......................................................................................... 14   Table 6  : MIFARE Ultralight Memory Map ............................................................................................ 15   Table 7  : Error Codes ........................................................................................................................... 44       ACR122U – Application Programming Interface  info@acs.com.hk Version 2.04 www.acs.com.hk Page 4 of 49  1.0. Introduction The ACR122U is a PC-linked contactless smart card reader/writer used for accessing ISO 14443-4 Type A and Type B, MIFARE®, ISO 18092, and FeliCa tags. The ACR122U is PC/SC compliant making it compatible with existing PC/SC applications. The ACR122U serves as the intermediary device between the computer and the contactless tag via the USB interface. The reader carries out the command from the computer whether the command is used to communicate with a contactless tag, or control the device peripherals (LED or buzzer). This  API document will discuss in detail how the PC/SC commands were implemented for the contactless interface and device peripherals of the ACR122U. 1.1. Features ã  USB 2.0 Full Speed Interface ã  CCID Compliance ã  Smart Card Reader: o  Read/Write speed of up to 424 Kbps o  Built-in antenna for contactless tag access, with card reading distance of up to 50 mm (depending on tag type) o  Support for ISO 14443 Part 4 Type A and B cards, MIFARE, FeliCa, and all four types of NFC (ISO/IEC 18092 tags) o  Built-in anti-collision feature (only one tag is accessed at any time) o  Application Programming Interface: o  Supports PC/SC o  Supports CT-API (through wrapper on top of PC/SC) o  Built-in Peripherals: o  User-controllable bi-color LED o  User-controllable buzzer o  Supports Android™ 3.1 and above o  Compliant with the following standards: o  IEC/EN 60950 o  ISO 18092 o  ISO 14443 o  CE o  FCC o  KC o  VCCI o  MIC o  PC/SC o  CCID o  Microsoft® WHQL o  RoHS 2
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks