mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-19 01:03:22 +00:00
8632c77d68
* Adding MIFARE 1K Infineon Compatibility As per Issue #1342, MIFARE Classic 1K Cards from NXP have the SAK value of 0x08. MIFARE Classic 1K Cards from Infineon have an SAK value of 0x88. Adding the SAK values accordingly so that Infineon tags are properly handled.
17 lines
561 B
C
17 lines
561 B
C
#include "mifare_common.h"
|
|
|
|
MifareType mifare_common_get_type(uint8_t ATQA0, uint8_t ATQA1, uint8_t SAK) {
|
|
MifareType type = MifareTypeUnknown;
|
|
|
|
if((ATQA0 == 0x44) && (ATQA1 == 0x00) && (SAK == 0x00)) {
|
|
type = MifareTypeUltralight;
|
|
} else if(
|
|
((ATQA0 == 0x44 || ATQA0 == 0x04) && (SAK == 0x08 || SAK == 0x88)) ||
|
|
((ATQA0 == 0x42 || ATQA0 == 0x02) && (SAK == 0x18))) {
|
|
type = MifareTypeClassic;
|
|
} else if(ATQA0 == 0x44 && ATQA1 == 0x03 && SAK == 0x20) {
|
|
type = MifareTypeDesfire;
|
|
}
|
|
|
|
return type;
|
|
}
|