@@ -14,6 +14,7 @@ namespace {
1414constexpr char type_unknown[] = " Unknown" ;
1515constexpr char type_classic[] = " MIFARE Classic" ;
1616constexpr char type_classic_1K[] = " MIFARE Classsic 1K" ;
17+ constexpr char type_classic_2K[] = " MIFARE Classsic 2K" ;
1718constexpr char type_classic_4K[] = " MIFARE Classsic 4K" ;
1819constexpr char type_ultra_light[] = " MIFARE Ultralight" ;
1920constexpr char type_ultra_light_c[] = " MIFARE UltralightC" ;
@@ -33,25 +34,25 @@ constexpr char type_iso14443_4[] = "ISO14443-4";
3334constexpr char type_iso18092[] = " ISO18092" ;
3435constexpr char type_not_completed[] = " NOT COMPLEDTED" ;
3536constexpr const char * type_table[] = {
36- type_unknown, //
37- type_classic, type_classic_1K, type_classic_4K, // Classic
38- type_ultra_light, type_ultra_light_c, // Light
39- type_plus_2K, type_plus_4K, // Plus
40- type_desfire_2K, type_desfire_4K, type_desfire_8K, // DESFire
41- type_ntag203, type_ntag210u, type_ntag210, // NTAG
42- type_ntag212, type_ntag213, type_ntag215, // NTAG
43- type_ntag216, // NTAG
44- type_iso14443_4, type_iso18092, //
37+ type_unknown, //
38+ type_classic, type_classic_1K, type_classic_2K, type_classic_4K, // Classic
39+ type_ultra_light, type_ultra_light_c, // Light
40+ type_plus_2K, type_plus_4K, // Plus
41+ type_desfire_2K, type_desfire_4K, type_desfire_8K, // DESFire
42+ type_ntag203, type_ntag210u, type_ntag210, // NTAG
43+ type_ntag212, type_ntag213, type_ntag215, // NTAG
44+ type_ntag216, // NTAG
45+ type_iso14443_4, type_iso18092, //
4546};
4647
4748// included system area
4849constexpr uint16_t max_block_table[] = {
49- 0 , // Unknown
50- 20 , 64 , 256 , // Classic
51- 16 , 48 , // Light
52- 128 , 256 , // Plus
53- 0 , 0 , 0 , // DESFire (Not has blocks, File base system)
54- 42 , 19 , 16 , 40 , 44 , 134 , 230 // NTAG
50+ 0 , // Unknown
51+ 20 , 64 , 128 , 256 , // Classic
52+ 16 , 48 , // Light
53+ 128 , 256 , // Plus
54+ 0 , 0 , 0 , // DESFire (Not has blocks, File base system)
55+ 42 , 19 , 16 , 40 , 44 , 134 , 230 // NTAG
5556};
5657
5758// [min/max]
@@ -60,6 +61,7 @@ constexpr uint8_t user_block_table[][2] = {
6061 // Classic
6162 {1 , 19 },
6263 {1 , 63 },
64+ {0 , 127 },
6365 {0 , 255 },
6466 // Light
6567 {4 , 15 },
@@ -82,10 +84,10 @@ constexpr uint8_t user_block_table[][2] = {
8284};
8385
8486constexpr uint8_t max_sector_table[] = {
85- 0 , //
86- 5 , 16 , 40 , // Classic
87- 0 , 0 , // Light
88- 32 , 40 , // Plus
87+ 0 , //
88+ 5 , 16 , 32 , 40 , // Classic
89+ 0 , 0 , // Light
90+ 32 , 40 , // Plus
8991};
9092
9193} // namespace
@@ -117,14 +119,13 @@ Type get_type(const uint8_t sak)
117119 case 0x09 :
118120 return Type::MIFARE_Classic;
119121 case 0x10 :
122+ return Type::MIFARE_Plus_2K;
120123 case 0x11 :
121- return Type::MIFARE_Plus_2K; // or 4K
124+ return Type::MIFARE_Plus_4K;
122125 case 0x18 :
123126 return Type::MIFARE_Classic_4K;
124127 case 0x19 :
125- // AN10833 says Classic 2K but does not exist as a product?
126- [[fallthrough]] ;
127- // Fall through
128+ return Type::MIFARE_Classic_2K;
128129 default :
129130 break ;
130131 }
0 commit comments