Advanced Card ACR20 Program Reference Manual

Smart card reader

Advertisement

Quick Links

Smart Card Reader Driver Program Reference Manual
Advanced Card Systems Ltd.
Room 302, 3/F., Shun Fat Industrial building,
17 Wang Hoi Road, Kowloon Bay,Kowloon, Hong Kong.
 Advanced Card Systems Ltd.
ACSR20
Application Programming Interface
ACR20 & ACR30 Smart Card Reader
Tel: 852-2796 7873
Website: www.acs.com.hk
rev 1.1 Sept, 2003
Fax: 852-2796 1286
E-mail : info@acs.com.hk
Page 1 of 34

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ACR20 and is the answer not in the manual?

Questions and answers

Summary of Contents for Advanced Card ACR20

  • Page 1 Smart Card Reader Driver Program Reference Manual rev 1.1 Sept, 2003 ACSR20 Application Programming Interface ACR20 & ACR30 Smart Card Reader Advanced Card Systems Ltd. Tel: 852-2796 7873 Fax: 852-2796 1286 Room 302, 3/F., Shun Fat Industrial building, Website: www.acs.com.hk E-mail : info@acs.com.hk...
  • Page 2: Table Of Contents

    ACI_WritePr………………………………………………… 2.3.3.5 ACI_Erase………………………………………………….. 2.3.3.6 ACI_ChangePIN…………………………………………… 2.3.3.7 ACI_Verify………………………………………………….. 2.3.3.8 ACI_Authenticate………………………………………….. 2.3.3.9 ACI_SetFuse……………………………………………….. 2.3.3.10 ACI_CardOptions………………………………………….. 2.3.3.11 ACI_ReadProtect………………………………………….. 2.3.3.12 ACI_SetProtect…………………………………………….. 2.3.3.13 ACI_ClearProtect……………………………………….…. 2.3.3.14 ACI_LockProtect…………………………………………… 2.3.3.15 ACI_WriteAll………………………………………………... 2.3.3.16 ACI_SetHE…………………………………………………. 2.3.3.17 ACI_BlowFuse……………………………………………... 2.3.3.18 ACI_EraseAll……………………………………………….. 2.3.3.19 ACI_Reactivate……………………………………………..  Advanced Card Systems Ltd. Page 2 of 34...
  • Page 3 2.4.6 The Xicor Card X76F100 ……………………………………………… Appendix A : Table of error codes …………………………………………………………. Appendix B : Supporting Memory Card Commands ……………………………………... Appendix C : Table of card types compatibility ……………………………………………  Advanced Card Systems Ltd. Page 3 of 34...
  • Page 4: Introduction

    It can be programmed using the popular development tools like Visual C/C++, Borland C/C++, Visual Basic, Delphi, FoxPro, etc… Depending on the reader model, ACR20 & ACR30 series of smart card readers can be connected to the PC via the RS/232 interface or USB interface. The connecting interfaces of...
  • Page 5: Acsr20

    (ACSR20 API) for the application to operate on the card reader and the corresponding inserted card. ACSR20 communicates with the ACR10/ACR20 reader via the communication port facilities provided by the operating system. ACSR20 is supposed to be platform independent provided that there is a minor modification on the communication module of the ACSR20 to adapt to different operating environment.
  • Page 6: Ac_Apdu

    INT16 APDULenMax; // Max. APDU supported } AC_SESSION; The AC_SESSION data structure is used in the AC_StartSession function call for the retrieval of ATR information from the smart card. Before calling AC_StartSession, the program needs  Advanced Card Systems Ltd. Page 6 of 34...
  • Page 7: Ac_Info

    The maximum number of response data byte (DataOut) that will be appeared in the ExchangeAPDU command CType The card types supported by the reader (For details, please look at the ACR20 reference manual) Cstat The status of the card reader Bit0 = card present (1) or absent (0)
  • Page 8: Interface Function Prototypes

    ReaderType Reader type and communication speed. ACR10 = Target reader is ACR10 (9600bps) ACR20 = Target reader is ACR20 (57600bps) ACR20_57600 = Target reader is ACR20 (57600bps) ACR20_19200 = Target reader is ACR20 (19200bps) ACR20_115200 = Target reader is ACR20 (115200bps)
  • Page 9: Ac_Close

    When an ACR20 is reset, the green LED will flash three times. There is no reset for an ACR10 reader. When the application want to access the security module, it needs to open (use the AC_Open command) the reader for the second time to get a different handler for the handling of the security module session.
  • Page 10: Ac_Startsession

    The return value is zero if the function is successful. Otherwise, it returns a negative value containing the error code. For the detailed meaning of the error code, please refer to appendix A.  Advanced Card Systems Ltd. Page 10 of 34...
  • Page 11: Ac_Endsession

    The return value is zero if the function is successful. Otherwise, it returns a negative value containing the error code. For the detailed meaning of the error code, please refer to appendix A. Examples: //End session on a previously started session RtnCode = AC_EndSession(hReader);  Advanced Card Systems Ltd. Page 11 of 34...
  • Page 12: Ac_Exchangeapdu

    The return value is zero if the function is successful. Otherwise, it returns a negative value containing the error code. For the detailed meaning of the error code, please refer to appendix A.  Advanced Card Systems Ltd. Page 12 of 34...
  • Page 13: Ac_Getinfo

    = no card inserted = card inserted, not powered up = card powered up Info.CSel The currently selected card type Info.nLibVer Current library version (e.g. 310 is equal to version 3.10)  Advanced Card Systems Ltd. Page 13 of 34...
  • Page 14: Ac_Setoptions

    Options : Options Type Value Set the communication baud rate ACO_SET_BAUD_RATE ACO_B9600 between the reader and the host ACO_B14400 ACO_B19200 ACO_B28800 ACO_B38400 ACO_B57600 ACO_B115200 Set the communication inter ACO_SET_CHAR_DELAY 0-255  Advanced Card Systems Ltd. Page 14 of 34...
  • Page 15 Notes: Please notice that many options are not available for the ACR10 reader. You will have an error return if you are calling it with the ACR10 reader.  Advanced Card Systems Ltd. Page 15 of 34...
  • Page 16: Aci Commands

    Variable Lc bytes of data to be written into the card 0x00 No response data expected from the card. For AM256 card, this value will rounded to the next even number  Advanced Card Systems Ltd. Page 16 of 34...
  • Page 17: Aci_Writecarry

    LSB of the starting address to be erased variable <= 32 The number of bytes to be erased from the card DataIn Don't care 0x00 No response data expected from the card  Advanced Card Systems Ltd. Page 17 of 34...
  • Page 18: Aci_Changepin

    Lc bytes of key value to be verified by the card variable Case when : - AC_AM2KS : Le = 4 AC_AM8KS : Le = 3 otherwise : Le = 0  Advanced Card Systems Ltd. Page 18 of 34...
  • Page 19 0x00 Read array 0 password 0x01 Read array 1 password AC_X76F640 0x02 Write array 0 password 0x03 Write array 1 password 0x04 Reset password AC_X76F100 0x00 Write password 0x01 Read password  Advanced Card Systems Ltd. Page 19 of 34...
  • Page 20: Aci_Authenticate

    0x01 = Set Fuse PIN to high (5V) 0xFF = Set Fuse PIN to low (0V) Don't care 0x00 No input data for this command DataIn Don't care 0x00 No output data expected from this command  Advanced Card Systems Ltd. Page 20 of 34...
  • Page 21: Aci_Cardoptions

    Case when : - XIIC : Le = 3 AM256 : Le = 1 AM4KP : Le = 1 X76F041 : Le = 5 AM2KS : Le=4 AM8KS : Le=3  Advanced Card Systems Ltd. Page 21 of 34...
  • Page 22 For the details meaning of each byte, please refer back to the technical specification of the X76F041 chip. Byte position Name Meaning ACR1 Array Control Register 1 ACR2 Array Control Register 2 Configuration Register Retry Register Retry Counter  Advanced Card Systems Ltd. Page 22 of 34...
  • Page 23: Aci_Setprotect

    XIIC, AM256, AM4KP : Lc = 0 X76F041 : Lc = 5 DataIn variable Case when : - XIIC, AM256, AM4KP : No input data X76F041 : Configuration Register 0x00 No output data expected from this command  Advanced Card Systems Ltd. Page 23 of 34...
  • Page 24: Aci_Clearprotect

    Instruction class ACI_LockProtect Instruction code 0x00 must be zero 0x00 must be zero 0x00 No input data for this command DataIn No input data 0x00 No output data expected from this command  Advanced Card Systems Ltd. Page 24 of 34...
  • Page 25: Aci_Writeall

    0 ≤ P1 ≤ 0x0F New block number of the High Endurance memory block Don’t care 0x00 No input data for this command DataIn No input data 0x00 No output data expected from this command  Advanced Card Systems Ltd. Page 25 of 34...
  • Page 26: Aci_Blowfuse

    Case when : - X76F041 : Lc = 8 Others : Lc = 0 DataIn variable Case when : - X76F041 : configuration password 0x00 No output data expected from this command  Advanced Card Systems Ltd. Page 26 of 34...
  • Page 27: Aci_Reactivate

    0x00 Instruction class ACI_Reactivate Instruction code 0x00 must be zero 0x00 must be zero 0x00 no input data DataIn variable no input data 0x00 No output data expected from this command  Advanced Card Systems Ltd. Page 27 of 34...
  • Page 28: Programmer Notes

    The ACI_ReadProtect and ACI_WriteProtect commands can be used to manage the configuration registers after the configuration password is verified OK. The detail meaning of the configuration registers can be found in the X76F041 data book.  Advanced Card Systems Ltd. Page 28 of 34...
  • Page 29: The Xicor Card X24645 And The Iic Card

    (S1, S2) allow up to four devices to share a common two wire bus. In the ACR10/ACR20 reader, these two select inputs are interpret as the two most significant bits of a 15 bit address word. The following diagram illustrate the structure of the address word.
  • Page 30: The Am221 (Sle4436, Gam226) Type

    AC_X76F128 1015). For the X76F128 / X76F640 / X76F100, it has a retry counter of 8 attempts. AC_X76F640 AC_X76F100 Others No direct way to know the verification is successful or not.  Advanced Card Systems Ltd. Page 30 of 34...
  • Page 31: The Xicor Card X76F128 / X76F640

    For the changing of either one of the password (ACI_ChangePIN), it is required to have the write password to be verified OK.  Advanced Card Systems Ltd. Page 31 of 34...
  • Page 32: Appendix A : Table Of Error Codes

    Unknown response -2000 USB internal error -2001 Error in memory allocation -2002 Error in linking USB library -2003 Error in locating window system directory -3000 Error found in PCSC smart card manager  Advanced Card Systems Ltd. Page 32 of 34...
  • Page 33: Appendix B : Supporting Memory Card Commands

    X X X X AC_T0 AC_T1 AC_SCM odule AC_AM 256 X X X AC_AM 4KP X X X X AC_X76F041 AC_X24645 AC_ST1335 X X X AC_ST1333 X X X AC_X76F128 AC_X76F640 AC_X76F100  Advanced Card Systems Ltd. Page 33 of 34...
  • Page 34: Appendix C : Table Of Card Types Compatibility

    All T=0 / T=1 security module in SIMM form  Advanced Card Systems Ltd. 1996-2002. The information contained herein is subject to change without notice. Advanced Card Systems assumes no responsibility for the use of any circuitry other than circuitry embodied in an Advanced Card Systems product.

This manual is also suitable for:

Acr30Acsr20

Table of Contents