diff options
author | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2008-01-29 15:05:22 +0000 |
---|---|---|
committer | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2008-01-29 15:05:22 +0000 |
commit | 591a1b00c180e176dd03d9d05ed8fa4964a74765 (patch) | |
tree | cde79dc129e2110b2ff480c455068368a7eb27fd /include | |
parent | 36a703f8f4302ba26bf34711f31db847945b4c6f (diff) |
* fix length of mifare classic block
* add mifare classic block/sector conversion functions
git-svn-id: https://svn.gnumonks.org/trunk/librfid@2062 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'include')
-rw-r--r-- | include/librfid/rfid_protocol_mifare_classic.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/librfid/rfid_protocol_mifare_classic.h b/include/librfid/rfid_protocol_mifare_classic.h index e50cd2f..bfa49ba 100644 --- a/include/librfid/rfid_protocol_mifare_classic.h +++ b/include/librfid/rfid_protocol_mifare_classic.h @@ -12,11 +12,16 @@ #define MIFARE_CL_KEY_LEN (sizeof(MIFARE_CL_KEYA_DEFAULT)-1) #define MIFARE_CL_PAGE_MAX 0xff -#define MIFARE_CL_PAGE_SIZE 20 +#define MIFARE_CL_PAGE_SIZE 0x10 #define RFID_CMD_MIFARE_AUTH1A 0x60 #define RFID_CMD_MIFARE_AUTH1B 0x61 +#define MIFARE_CL_BLOCKS_P_SECTOR_1k 4 +#define MIFARE_CL_BLOCKS_P_SECTOR_4k 16 +#define MIFARE_CL_SMALL_SECTORS 32 +#define MIFARE_CL_LARGE_SECTORS 4 + enum rfid_proto_mfcl_opt { RFID_OPT_P_MFCL_SIZE = 0x10000001, }; @@ -37,5 +42,8 @@ extern const struct rfid_protocol rfid_protocol_mfcl; extern int mfcl_set_key(struct rfid_protocol_handle *ph, unsigned char *key); extern int mfcl_auth(struct rfid_protocol_handle *ph, u_int8_t cmd, u_int8_t block); +extern int mfcl_sector2block(u_int8_t sector); +extern int mfcl_block2sector(u_int8_t block); +extern int mfcl_sector_blocks(u_int8_t sector); #endif /* _MIFARE_CLASSIC_H */ |