ACR1281U-C8 – Application Programming Interface
Version 1.00
www.acs.com.hk
Page 29 of 52
5.0. Card Commands for Mifare® 1K/4K Cards
5.1. ACR120_Login
Performs an authentication to access one sector of the card. Only one sector can be accessed at a
time.
High Level API
:
DLLAPI INT16 AC_DECL
ACR120_Login( INT16 hReader,
UINT8 Sector,
UINT8 KeyType,
INT8 StoredNo,
UINT8 pKey[6]);
Parameters
Description
hReader
Handle to the reader returned by AC_Open()
Sector
Sector number to login
KeyType
Type of key. It can be:
AC_MIFARE_LOGIN_KEYTYPE_A,
AC_MIFARE_LOGIN_KEYTYPE_B,
AC_MIFARE_LOGIN_KEYTYPE_DEFAULT_A,
AC_MIFARE_LOGIN_KEYTYPE_DEFAULT_B,
AC_MIFARE_LOGIN_KEYTYPE_DEFAULT_F,
AC_MIFARE_LOGIN_KEYTYPE_STORED_A and
AC_MIFARE_LOGIN_KEYTYPE_STORED_B
StoredNo
The stored number of key if keyType =
AC_MIFARE_LOGIN_KEYTYPE_STORED_A or
AC_MIFARE_LOGIN_KEYTYPE_STORED_B.
pKey
The login key if keyType =
AC_MIFARE_LOGIN_KEYTYPE_A or
AC_MIFARE_LOGIN_KEYTYPE_B. It’s
AC_MIFARE_KEY_LEN(6) bytes long.
Return Value
INT16
Result code. 0 means success.
Table 20
: ACR120_Login Command Description