]>
Commit | Line | Data |
---|---|---|
f38a1528 | 1 | //----------------------------------------------------------------------------- |
2 | // Copyright (C) 2014 Iceman | |
3 | // | |
4 | // This code is licensed to you under the terms of the GNU GPL, version 2 or, | |
5 | // at your option, any later version. See the LICENSE.txt file for the text of | |
6 | // the license. | |
7 | //----------------------------------------------------------------------------- | |
8 | // High frequency MIFARE Desfire commands | |
9 | //----------------------------------------------------------------------------- | |
10 | ||
11 | int CmdHFMFDes(const char *Cmd); | |
12 | int CmdHF14ADesAuth(const char* cmd); | |
13 | int CmdHF14ADesRb(const char* cmd); | |
14 | int CmdHF14ADesWb(const char* cmd); | |
15 | int CmdHF14ADesInfo(const char *Cmd); | |
16 | int CmdHF14ADesEnumApplications(const char *Cmd); | |
95e63594 | 17 | |
f38a1528 | 18 | char * GetCardSizeStr( uint8_t fsize ); |
f38a1528 | 19 | char * GetProtocolStr(uint8_t id); |
f6c18637 | 20 | void GetKeySettings( uint8_t * aid); |
313ee67e | 21 | |
75465377 | 22 | // Command options for Desfire behavior. |
23 | enum { | |
24 | NONE = 0x00, | |
25 | INIT = 0x01, | |
26 | DISCONNECT = 0x02, | |
f6c18637 | 27 | CLEARTRACE = 0x04, |
75465377 | 28 | BAR = 0x08, |
29 | } CmdOptions ; | |
313ee67e | 30 | |
31 | ||
f6c18637 | 32 | #define CREATE_APPLICATION 0xca |
33 | #define DELETE_APPLICATION 0xda | |
34 | #define GET_APPLICATION_IDS 0x6a | |
35 | #define SELECT_APPLICATION 0x5a | |
36 | #define FORMAT_PICC 0xfc | |
313ee67e | 37 | #define GET_VERSION 0x60 |
38 | #define READ_DATA 0xbd | |
39 | #define WRITE_DATA 0x3d | |
40 | #define GET_VALUE 0x6c | |
41 | #define CREDIT 0x0c | |
42 | #define DEBIT 0xdc | |
43 | #define LIMITED_CREDIT 0x1c | |
44 | #define WRITE_RECORD 0x3b | |
45 | #define READ_RECORDS 0xbb | |
46 | #define CLEAR_RECORD_FILE 0xeb | |
47 | #define COMMIT_TRANSACTION 0xc7 | |
48 | #define ABORT_TRANSACTION 0xa7 | |
49 | #define GET_FREE_MEMORY 0x6e | |
50 | #define GET_FILE_IDS 0x6f | |
f6c18637 | 51 | #define GET_ISOFILE_IDS 0x61 |
313ee67e | 52 | #define GET_FILE_SETTINGS 0xf5 |
53 | #define CHANGE_FILE_SETTINGS 0x5f | |
54 | #define CREATE_STD_DATA_FILE 0xcd | |
55 | #define CREATE_BACKUP_DATA_FILE 0xcb | |
56 | #define CREATE_VALUE_FILE 0xcc | |
57 | #define CREATE_LINEAR_RECORD_FILE 0xc1 | |
58 | #define CREATE_CYCLIC_RECORD_FILE 0xc0 | |
59 | #define DELETE_FILE 0xdf | |
60 | #define AUTHENTICATE 0x0a // AUTHENTICATE_NATIVE | |
61 | #define AUTHENTICATE_ISO 0x1a // AUTHENTICATE_STANDARD | |
62 | #define AUTHENTICATE_AES 0xaa | |
63 | #define CHANGE_KEY_SETTINGS 0x54 | |
64 | #define GET_KEY_SETTINGS 0x45 | |
65 | #define CHANGE_KEY 0xc4 | |
66 | #define GET_KEY_VERSION 0x64 | |
3d93d4f9 | 67 | #define AUTHENTICATION_FRAME 0xAF |
68 | ||
f6c18637 | 69 | #define MAX_NUM_KEYS 0x0F |
3d93d4f9 | 70 | #define MAX_APPLICATION_COUNT 28 |
f6c18637 | 71 | #define MAX_FILE_COUNT 32 |
3d93d4f9 | 72 | #define MAX_FRAME_SIZE 60 |
73 | #define NOT_YET_AUTHENTICATED 255 | |
74 | #define FRAME_PAYLOAD_SIZE (MAX_FRAME_SIZE - 5) |