background image

12

fw_pro_commandlink

Information exchange function

Desfire card specific function

Function Name

Description

fw_anticoll2

The second anti-collision

fw_select2

The second finding card

fw_reset_desfire

Reset card

fw_authen_desfire

Verify secret key

fw_getver_desfire

Get the related data of the card

fw_getAIDs_desfire

Get application identifier

fw_selectApp_desfire

Select application

fw_getKeySetting_desfire

Get the setting information of the master secret key

fw_getKeyver_desfire

Get the version message of the master secret key

fw_createApp_desfire

Creat application

fw_delAID_desfire

Delete application

fw_changeKeySetting_desfire

Change the setting information of the master secret key

fw_changeKey_desfire

Modify the secret key

fw_getFileIDs_desfire

Get file identifier

fw_getFileProper

Get file properties

fw_changeFileSetting

Change file properties

fw_createDataFile_desfire

Creat a standard data file

fw_createValueFile_desfire

Creat value file

fw_createCsyRecord_desfire

Creat cycle record file

fw_delFile_desfire

Delect file

fw_write_desfire

Write data file

fw_read_desfire

Read record file

fw_getvalue_desfire

Read value file

fw_credit_desfire

Increment

Содержание E7

Страница 1: ...SHENZHEN FONGWAH TECHNOLOGY CO LTD Address The 3rd floor Dakan industrial Road 1 14A Xili Town Nanshan District Shenzhen Guangdong China Zip Code 518000 Tel 086 755 26923337 Fax 086 755 26922227 E mail market fongwah com URL http www fongwah com ...

Страница 2: ...CPU card ISO14443 specific function 11 Desfire card specific function 12 CPU SAM card specific functions 13 4442 card specific functions 13 4428 Card Specific Functions 13 1 9 Error codes and Meanings 14 2 API Function 15 2 1 Common Functions 15 2 2 Device Functions 17 2 3 Keyboard Special Functions 20 2 4 S50 M1 Functions 21 2 5 S70 card specific function 30 2 6 Ultralight card specific function ...

Страница 3: ...3 4 Appendix 68 4 1 Table 1 Mifare Plus card personalized structure 68 ...

Страница 4: ...ontact CPU card E7 IC card reader widely used in financial payment E commere payment system One Card consume system and supply chain management 1 2 Features Support Protocol ISO14443 A ISO7816 Recognition Distance 0 50mm Physical Interface USB or Serial port Communication Rate 9600bps 115200bps Operating System Windows 98 Me 2K XP 2003 Vista 及 Linux LED Display 128 64 dot matrix display LCD screen...

Страница 5: ...5 ...

Страница 6: ...6 1 4 Peader Packing List Contains Reader Communication cable and Warranty Card 1 5 Software Contains Demo Program Lib of Function and Application Examples a Demo Program E7 exe ...

Страница 7: ...wing rules 1 Call function fw_init first to initial Serial Interface or USB interface 2 Call function fw_load_key to load key from card to Reader a section once 3 Call funtion fw_card equivalent to continuous calls fw_request fw_anticoll fw_select 3 functions to get card serial number 4 Call function fw_authentication to verify keys of Device and Card once a section 5 You can read write initialize...

Страница 8: ...ion Name Description fw_init Initialize the communication port fw_exit Close the port fw_des Encrypt Decrypt fw_config_card Set operation card type a_hex Convert hex string to the corresponding characters of ordinary ASC hex_a Convert ordinary ASC to the corresponding hex string Device Function Function Name Description fw_beep Make beep fw_getver Get the version of Reader fw_GetDevSN Get serial n...

Страница 9: ...turn to normal state after that fw_CheckKeyValue Inquiry the key value S50 card functions Function Name Description fw_init Initialize the communication port fw_exit Close the port fw_card Find card fw_card_hex Find card fw_card_str Find card fw_request Find card request fw_anticoll Anti collision fw_select Select a card fw_load_key Load password of sectors fw_authentication Verify sector s passwo...

Страница 10: ...nction Function Name Description fw_request_ultralt Request of Finding Ultralight card fw_anticall_ultralt Anti collision Ultralight card fw_select_ultralt Select Ultralight card fw_read_ultralt Read Ultralight card fw_write_ultralt Write Ultralight card fw_halt_ultralt Abort the operation with Ultralight card Ultralight C card specific function Function Name Description fw_ultralt_C_authen Verify...

Страница 11: ...key of the level 3 fw_MFPlusL3_UpdateKey Update the secret key of the level 3 fw_MFPlusL3_AuthenSectorKey Verify the secter s secret key of the level 3 fw_MFPlusL3_ReadWithPlain Read in clear text in the third level fw_MFPlusL3_WriteWithPlain Write in clear text in the third level fw_MFPlusL3_ReadWithEncrypt Read in encryption mode in the third level fw_MFPlusL3_WriteWithEncrypt Write in encryptio...

Страница 12: ... Get the version message of the master secret key fw_createApp_desfire Creat application fw_delAID_desfire Delete application fw_changeKeySetting_desfire Change the setting information of the master secret key fw_changeKey_desfire Modify the secret key fw_getFileIDs_desfire Get file identifier fw_getFileProper Get file properties fw_changeFileSetting Change file properties fw_createDataFile_desfir...

Страница 13: ...operation fw_cpuapdu Information transfer between CPU and APDU 4442 card specific functions Function name Description fw_authentikey_4442 Authenticate key of 4442 card fw_read_4442 Read data from 4442 card fw_write_4442 Write data from 4442 card fw_getProtectData_4442 Get protected data fw_setProtectData_4442 Set protected data fw_changkey_4442 Change key of 4442 card fw_cntReadError_4442 Get the ...

Страница 14: ...cation error 0xd7 215 CPU card command returns error 0x01 001 No card or certificate error 0x02 002 Data verification error 0x03 003 Value is null error 0x04 004 Authentication failed 0x05 005 Parity error 0x06 006 Communication between Reader and card error 0x08 008 Read card serial number error 0x09 009 Password type error 0x0a 010 Card has not been certified 0x0b 011 Read operating bits error 0...

Страница 15: ...it 100 0 initialize USB interface commdev fw_init 0 9600 initial serial interface Baud rate 9600 Remark If there are more than one Reader connected to the computer call this function can get their handle each Next is an example int icdev1 icdev2 icdev3 presume there are three readers connected icdev1 fw_init 100 0 get the first device handle icdev2 fw_init 100 1 get the second device handle icdev3...

Страница 16: ...rt Parameters a Converted characters hex the characters to be converted len the length of character a Return Value 0 if successful otherwise Nonzero Example int st Unsigned char hexbuf 8 3 1 6 1 4 d Unsigned char abuf 4 st a_hex abuf hexbuf 3 abuf 1aM void hex_a unsigned char hex unsigned char a __int16 len Description String conversion function ordinary characters convert into hexadecimal charact...

Страница 17: ... encrypt s szDest memset szSour 0 sizeof szSour Clear szSour and use it to store the result of decrypt st fw_des szKey szDest szSour 0 Decrypt printf The result of decrypt s szSour Remark The three parameters key sour dest are all a string the length of which is 16 and the character of the string are hex model 2 2 Device Functions int fw_beep int icdev unsigned int _Msec Description Make beep Para...

Страница 18: ...cdev devSN snLen int fw_GetDeviceMemSize int icdev unsinged int size Description Get size of device s eeprom Parameters icdev Value of Device Handle snSize out size of eeprom bytes Return Value 0 if successful otherwise errorCode Example unsigned int memSize fw_GetDeviceMemSize icdev memSize int fw_srd_eeprom int icdev int offset int length unsigned char rec_buffer Description Get remark informati...

Страница 19: ... Icdev Handle of Device _Msec Reset time unit is Millionseconds this value is 0 means off frequency 1 2 means reset time is 1 ms 2 ms Return Value 0 error The absolute value is the error number 0 sucessful Example st fw_reset icdev 2 int fw_lcd_setbright int icdev unsigned char bright Description Set LCD backlight on or off Parameters icdev Value of Device Handle bright sign of LCD light on or off...

Страница 20: ... fw_lcd_dispstr_ex icdev sendchs 2 2 7 1 int fw_lcd_dispclear int icdev Description Clear the display string of LCD Parameters icdev Value of Device Handle Return Value 0 if successful otherwise Nonzero Example st fw_lcd_dispclear icdev 2 3 Keyboard Special Functions __int16 fw_PassIn Int icdev unsigned char ctime Description Enter the status of getting keyboard key only to receive fw_PassGet and ...

Страница 21: ...stantly appears in the process of inquiring indicates that inputting has been not completed You can implement the IC_PassGet function to get password __int16 fw_PassCancel Int icdev Description Cancel the status of inputting password the device recovers the normal status Parameter icdev Value of device handle Return 0 if successful otherwise Nonzero __int16 fw_ CheckKeyValue int icdev unsigned cha...

Страница 22: ...char long or will be automatically converted into a signed one Recommended use a function fw_card_hex to return hex card number or a function fw_card_str to return Decimal card number int fw_card_hex int icdev unsigned char _Mode unsigned char Snrbuf Description Find card Get the card serial Number in working area hex string Parameters icdev Value of Device Handle _Mode Model of find card Value 0 ...

Страница 23: ...ode can operate one card once 1 ALL mode can operate serval card once Tagtype returned value of Card Type values mean following Eigenvalue decimal Card Type 4 MIFARE ONE M1 2 S70 8 MIFARE PRO 68 ULTRA LIGHT Return Value 0 if successful otherwise Nonzero Example int st unsigned int tagtype st fw_request icdev 0 tagtype int fw_anticoll int icdev unsigned char _Bcnt unsigned long _Snr Description Pre...

Страница 24: ...type fw_anticoll icdev 0 snr st fw_select icdev snr size int fw_load_key int icdev unsigned char _Mode unsigned char _SecNr unsigned char _NKey Description Load keys to RAM of Reader Parameters icdev Value of Device Handle _Mode The model of loading key Value are as follows For each sector of M1 card there are three sets of corresponding password KEYSET0 KEYSET1 KEYSET2 in the reader each password...

Страница 25: ...sword KEYB a total of six passwords use 0 2 4 6 to represent the six Password 0 KEYSET0 of KEYA 1 KEYSET1 of KEYA 2 KEYSET2 of KEYA 4 KEYSET0 of KEYB 5 KEYSET1 of KEYB 6 KEYSET2 of KEYB _SecNr The section number to verify Return Value 0 if successful otherwise Nonzero Example Verify section 4 key with 0 model if fw_authentication icdev 0 4 0 printf Authentication error int fw_authentication_pass i...

Страница 26: ...nsigned char _Data Description Read content of card For M1 card Read one block data 16 bytes once For ML card Read two pages with same property once 0 and 1 2 and 3 8 bytes Parameters icdev Value of Device Handle _Adr M1 Card Address of block M1 0 63 MS70 0 255 _Data out data of card Return Value 0 if successful otherwise Nonzero Example int st unsigned char data 16 st fw_read icdev 4 data Read bl...

Страница 27: ...the M1 card the 4th block of each sector is the password block for S70 card the 4th blocks of the first 32 sectors and the 16 th block of the last eight sectors is the password block rewriting password block must be carefully because the sector may damage after the rewrite operation int fw_halt int icdev Description Abort operation of card Parameters icdev Value of Device Handle Return Value 0 if ...

Страница 28: ...escription Initial value of block Parameters icdev Value of Device Handle _Adr Address of block _Value value of block for seting Return Value 0 if successful otherwise Nonzero Example int st unsigned long value value 1000 set value as 1000 st fw_initval icdev 1 value Initial value of block 1 as 1000 Remark During value operation you must first initialize the value function and then make the others...

Страница 29: ...ise Nonzero Example int st unsigned long value st fw_readval icdev 1 value Read out the value of block 1 and assign to value int fw_decrement int icdev unsigned char _Adr unsigned long _Value Description Decrement value of certain block Parameters icdev Value of Device Handle _Adr Address of block _Value Value for decrement Return Value 0 if successful otherwise Nonzero Example int st unsigned lon...

Страница 30: ...signed char _Adr Description this function transfers the contents of the internal register to the transmitted a ddress The sector must be authenticated for this operation The transfer function can only be called directly after increment decrement or restore Parameters icdev Value of Device Handle _Adr the address on the card to which the contents of the internal register is transferred to Return V...

Страница 31: ...4567890abcdef st fw_write_S70 icdev 100 data write data to block 100 2 6 Ultralight card specific function int fw_request_ultralt int icdev unsigned char _Mode Description Request of find card Parameters icdev Value of Device Handle _Mode Mode of find card 0 or 1 Return Value 0 if successful otherwise Nonzero Example int st st fw_request_ultralt icdev 0 remark Parameter _Mode can be set 0 or 1 int...

Страница 32: ...v Value of Device Handle iPage Index number of page redata received Data Return Value 0 if successful otherwise Nonzero Example read data of page 4 int st unsigned char ipage 4 unsigned char rebuffer 8 0 st fw_read_ultralt icdev ipage rebuffer int fw_write_ultralt int icdev unsigned char iPage unsigned char sdata Description Write data to Ultralight card Parameters icdev Value of Device Handle iPa...

Страница 33: ... icdev unsigned char key Description Verify the password of the card Parameters icdev handle of the device key password 16 bytes Return 0 if successful otherwise Nonzero Example int st unsigned char pkey 17 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f st fw_ultralt_C_authen icdev pkey int fw_ultralt_C_changePwd int icdev unsigned char keyold unsigned char keynew ...

Страница 34: ... reading int fw_ultralt_C_lockPage int icdev int flag Description Lock page once locked can t rewrite Parameters icdev handle of the device flag the page s sign 3 15 coreespond 3 15 41 43 coreespond 41 43 PAGE16_19 value is 16 coreesponding page 16 19 PAGE20_23 value is 20 coreesponding page 20 23 PAGE24_27 value is 24 coreesponding page 24 27 PAGE28_31 value is 28 coreesponding page 28 31 PAGE32_...

Страница 35: ...e of Device Handle slen Length of information for send sbuff buff for Information to send rlen Length of returned Information rbuff buff for returned Information Return Value 0 if successful otherwise Nonzero Example int st unsigned char slen rlen recdata 100 slen 7 unsigned char senddata 00A40000022F02 st fw_apdu_mifarepro icdev slen senddata rlen recdata 2 9 Contactless CPU card ISO1443 specific...

Страница 36: ...mmended that this value be less than 64 Return Value 0 if successful otherwise Nonzero Example __int16 st unsigned char srvBuffer 256 0x80 0x84 0x00 0x00 0x10 unsigned char revBuffer 256 0 unsigned char sendlen 5 unsigned char ftt 9 to delay 90ms unsigned char fFG 60 to send 60 bytes each time unsigned char revlen st fw_pro_commandlink icdev sendlen srvBuffer revlen revBuffer ftt fFG 2 10 Desfirec...

Страница 37: ...desifare card Parameters icdev Value of Device Handle rlen length of reset information rdata Return of the reset information Return Value 0 if successful otherwise Nonzero Example int st unsigned char revlen unsigned char revdata 50 st fw_reset_desfire icdev revlen revdata int fw_authen_desfire int icdev unsigned char keyNo char key unsigned char sessionKey Description Key authentication Parameter...

Страница 38: ... char data 50 st fw_getver_desfire icdev rlen data int fw_getAIDs_desfire int icdev unsigned char rlen unsigned char AIDS Description Get application identifier Parameters icdev Value of Device Handle rlen length of returned data AIDS Return of the identification number of all applications Return Value 0 if successful otherwise Nonzero Reference Table 1 11 Example int st unsigned char revlen unsig...

Страница 39: ...eyVer Description Get the version of master key Parameters icdev Value of Device Handle keyNo key numbers keyVer Key version Return Value 0 if successful otherwise Nonzero Reference Table 1 11 Example int st unsigned char keyVersion 3 st fw_getKeyver_desfire icdev 1 keyVersion int fw_createApp_desfire int icdev unsigned char AID unsigned char KeySetting unsigned char NumOfKey Description Creat app...

Страница 40: ... st unsigned char aid 3 0x02 0x00 0x00 st fw_delAID_desfire icdev aid int fw_changeKeySetting_desfire int icdev unsigned char newSet char sessionKey Description Change the master key settings Parameters icdev Value of Device Handle newSet new key settings The meaning of 8 bit Application master key can be decribed as below Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 changeKey Access Rights Bit3 change...

Страница 41: ...e deleting the application you must authenticate the master key of application or the master key of card successfully Bit1 this byte dertermines whether it needs to certificate the card master key for access to the application directory 0 fw_getAIDs_desfire and fw_getKeySetting_desfire need to successfully authenticate the master key of card 1 fw_getAIDs_desfire and fw_getKeySetting_desfire do not...

Страница 42: ...tFileIDs_desfire int icdev unsigned char rlen unsigned char fileIDs Description Get all file identification numbers of current application Parameters icdev Value of Device Handle Rlen the length of returned data fileIDs file identification number each byte means a file identification number Return Value 0 if successful otherwise Nonzero Reference Table 1 11 Example int st unsigned char revlen unsi...

Страница 43: ...to write to the file High nibble has the access to read the file sessionKey session key Return Value 0 if successful otherwise Nonzero Reference Table 1 11 Example Modify the setting of file with identification number of 0x01 int st unsigned char comSetting 0x01 MAC code verification unsigned char accessRights 3 0x22 0x22 to Read write read write to modify the settings all are required to verify t...

Страница 44: ...unsigned char lowerLimit unsigned char upperLimit unsigned char value unsigned char creditEnabled Description Create value file Parameters icdev Value of Device Handle fileNo File ID comSet data transmission form 0 transmission in the clear 1 MAC code validation 3 DES 3DES Encryption accessRight Access right accessRight 0 Low nibble has the right to modify access permissions High nibble has the ri...

Страница 45: ...ons High nibble has the right to read write the file accessRight 1 Low nibble has the access to write to the file High nibble has the access to read the file RecordSize the length of each record MaxNum the Max number of records Return Value 0 if successful otherwise Nonzero Reference Table 1 11 Example int st unsigned char comSetting 0x03 DES Encrypted transmission unsigned char accessRights 3 0x2...

Страница 46: ...8 data sesskey sesskey means the session key obtained by verifying key int fw_read_desfire int icdev unsigned char fileNo unsigned int offset unsigned int length unsigned char revData char sessionKey Description Read data file Parameters icdev Value of Device Handle fileNo File ID offset offset address length length of data to read revData the data to be read sessionKey session key Return Value 0 ...

Страница 47: ...session key Return Value 0 if successful otherwise Nonzero Reference Table 1 11 Example int st unsigned int value 100 set value 100 st fw_credit_desfire icdev 0x02 value sesskey sesskey means the session key obtained by verifying key Remark After this function called successfully you must also call the function fw_commitTransfer_desfire to make the operation into effect int fw_debit_desfire int ic...

Страница 48: ...d char data 8 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 st fw_writeRecord_desfire icdev 0x03 0 8 data sesskey sesskey means the session key obtained by verifying key Remark After this function called successfully you must also call the function fw_commitTransfer_desfire to make the operation into effect int fw_readRecord_desfire int icdev unsigned char fileNo unsigned int offset unsigned int length ...

Страница 49: ...sfire icdev 0x03 Remark after this function called successfully you must also call the function fw_commitTransfer_desfire to make the operation into effect int fw_commitTransfer_desfire int icdev Description commit a data transmission Parameters icdev Value of Device Handle Return Value 0 if successful otherwise Nonzero Reference Table 1 11 Example int st st fw_commitTransfer_desfire icdev Note af...

Страница 50: ... key unsigned short keyAddr Description The personalized setting of the card Parameters Ihic value of device handle Key secret key or data to set keyAddr the corresponding block number of secret key or data reference to appendix I Return 0 if successful otherwise Nonzero Example int st unsigned char mastKey 16 0x00 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 0x99 0xAA 0xBB 0x CC 0xDD 0xEE 0xFF st fw_M...

Страница 51: ...v keyL1 int fw_MFPlusL1_SwitchToL2 int ihic unsigned char key Description Verify two level secret key for one level card and upgrade to two level Parameters ihic value of device handle key two level secret key for upgrading Return 0 if successful otherwise Nonzero Example int st unsigned char keyL2 16 0x00 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 0x99 0xaa 0xbb 0xcc 0xd d 0x90 0x02 st fw_MFPlusL1_S...

Страница 52: ...lusL3_AuthenL3Key int ihic unsigned char key unsigned short keyAddr Description Verify three level secret key for three level card Parameters ihic value of device handle key three level secret key keyAddr the corresponding clock number of secret or data refer to appendix I Return 0 if successful otherwise Nonzero Example int st unsigned char key 16 0x00 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 0x99...

Страница 53: ...rwise Nonzero Example int st unsigned char key 16 0x00 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 0x99 0xaa 0xbb 0xcc 0xdd 0xEE 0xFF st fw_MFPlusL3_UpdateKey icdev 0x9000 key Update the master secret key int fw_MFPlusL3_ReadWithPlain int ihic unsigned int blkAddr unsigned char blkNum unsigned char rdata Description Read the block data of the three level card in the clear Parameters ihic handle of dev...

Страница 54: ...kAddr unsigned char blkNum unsigned char rdata unsigned char flag Description Read the block data of the three level card in the encryption way Parameters ihic handle of device blkAddr the starting block NO blkNum the number of clock to read Usually 1 3 rdata received data to be read flag sign bit 0 return after data decryption 1 directly return without the decryption Return 0 if successful otherw...

Страница 55: ...block for the three level card Parameters ihic handle of device blkAddr the block NO value value of initialize settings Example int st st fw_MFPlusL3_InitVal icdev 4 1000 int fw_MFPlusL3_ReadVal int ihic unsigned int blkAddr unsigned long value Description Read the value of the value block for the three level card check the balance Parameters ihic handle of device blkAddr the block NO value the va...

Страница 56: ...Reader Device Rlen out Length of returned reset information Rbuff store returned reset information Return Value 0 error its absolute value is error number 0 successful Example unsigned char rlen unsigned char DataBuffer 100 St fw_cpureset ICDev rlen DataBuffer __int16 fw_setcpu HANDLE ICDev unsigned char SAMID Description Set SAM Card deck for operation Parameters ICDev Handle of Reader Device SAM...

Страница 57: ...fw_setcpupara HANDLE ICDev unsigned char cputype unsigned char cpupro unsigned char cpuetu Description Set parameters of CPU card default parameter cpupro 0 T 0 protocol cpuetu 92 baud rate 9600 after power on Parameters ICDev Handle of Reader Device cputype Type of Deck ox0c Main deck ISO7816 0x0d SAM1 0x0e SAM2 0x0f SAM3 Cpupro Protocol of card value 0 T 0 Protocol value 1 T 1 protocol cpuetu Ti...

Страница 58: ...c Set to attached deck __int16 fw_cpuapdu HANDLE ICDev unsigned char slen unsigned char sbuff unsigned char rlen unsigned char rbuff Description Information transfer between CPU Card and APDU Application Protocol Data Unit This function encapsulates the T 0 and T 1 operation Parameters ICDev Handle of Reader Device slen Length of information for send sbuff Information buffer for send rlen Length o...

Страница 59: ... fw_write_4442 int icdev unsigned char _Adr unsigned char _Data int length Description Write data to 4442 card Parameters icdev Value of Device Handle _Adr Starting address for writing 0x30 0xff _Data Data for writing length Length of data to write Return Value 0 if successful otherwise Nonzero Example write 4 chars start from address 0x30 int st unsigned char sbuf 4 0x01 0x02 0x03 0x04 st fw_ wri...

Страница 60: ...rotected bits Parameters icdev Value of Device Handle _Adr Starting address for writing 0 32 _Data Data for writing length Length of data to write 0 32 Return Value 0 if successful otherwise Nonzero Example int st unsigned char rbuf 2 0xa2 0x1e st fw_setProtectData_4442 icdev 0 rbuf 2 Remark 1 parameter _Adr should be set to 0 32 2 Data for writing must be Consistent with the data stored in the ca...

Страница 61: ... set 3 key key data for updating 3 bytes Return Value 0 if successful otherwise Nonzero Example unsigned char keybuffer 3 0x00 0x00 0x00 if fw_changkey_4442 icdev 0 3 keybuffer 0 printf Change key error int fw_cntReadError_4442 int icdev unsigned char cntReadError Description Read counts of Error Code Parameters icdev Value of Device Handle cntReadError Times of Read Error Return Value 0 if succes...

Страница 62: ...lue of Device Handle _Adr The starting address of written data _Data data to be written length length of written data Return Value 0 if successful otherwise Nonzero Example write 4 bytes starting from address 0x30 int st unsigned char sbuf 4 0x01 0x02 0x03 0x04 st fw_write_4428 icdev 0x30 sbuf 4 remark 1 Parameter _Adr should value between 0x0 and 0x3ff 2 the value of parameter length should be le...

Страница 63: ...ev 0 rbuf 2 Remark 1 parameter _Adr should value between 0 and 1023 2 written data should be consistent with the corresponding data which stored in card 3 parameter length should not exceed 1024 int fw_authentikey_4428 int icdev unsigned char key Description Authenticate key of 4428 card Parameters icdev Value of Device Handle Key key to be verified 2 bytes Return Value 0 if successful otherwise N...

Страница 64: ...ssful otherwise Nonzero Example int st unsigned char nerror st fw_cntReadError_4428 icdev nerror 3 MIFARE ONE Card Structure Features 1K bytes of memory Composed of 16 sectors each sector has 4 blocks and each block has 16 bytes User can control the writing restrictions for each block Each sector has an independent set of passwords and access control Each card has a unique serial number with 32bit...

Страница 65: ... been Solidified and can not be changed The block 0 block 1 block 2 of other sectord is the data blocks used for storing data block 3 is the control block stored passwords A access control password B its structure as follows A0 A1 A2 A3 A4 A5 FF 07 80 69 B0 B1 B2 B3 B4 B5 Key A 6 bytes access control 4 bytes key B 6 bytes Sector Block 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description Number 0 Manual...

Страница 66: ...n be used to store data Value Block can be used as electronic purse valid commands read write increment decrement restore transfe the data of the value block only has 4 bytes Sector Trailer Block 3 Control Block Each sector has a control block block 3 including the key A 6 bytes and key B 6 bytes and a control bit 4 bytes Control Properties 1 the key and access control of each sector are independe...

Страница 67: ...t from the data block blocks 0 1 2 its access control are as follows key A Control bit Key B C13 C23 C33 Read Write Read Write Read Write 0 0 0 Never KeyA B KeyA B Never KeyA B KeyA B 0 1 0 Never Never KeyA B Never KeyA B Never 1 0 0 Never KeyB KeyA B Never Never KeyB 1 1 0 Never Never KeyA B Never Never Never 0 0 1 Never KeyA B KeyA B KeyA B KeyA B KeyA B 0 1 1 Never KeyB KeyA B KeyB Never KeyB 1...

Страница 68: ...MFP configuration block B000h The number of definition without MAC command Install identifier B001h Apply to the virtual card ATS message B002h Select the response message Answer to select The domain configuration block B003h The configuration if forcing to check to the nearest and make RandomID AES sector key 4000h 403Fh AESsector key 0 31sector The second byte defines the sector NO and KeyA KeyB...

Страница 69: ...fier ATS and itself Card s configuration key 9001 Apply to change the domain configuration block the key of virtual card and itself The two level conversion key 9002 Upgrade to the two level The three level conversion key 9003 Upgrade to the three level The verification key of one level card 9004 Extra AES verification key of one level card Selection key of virtual card A000 Count the key of MAC u...

Отзывы: