split nfcbarcode from iso14443a

This commit is contained in:
Philippe Teuwen 2019-08-03 21:17:52 +02:00
parent ada1b8559b
commit 4a3fb3ccf1
7 changed files with 25 additions and 5 deletions

View file

@ -27,13 +27,14 @@ APP_CFLAGS = $(PLATFORM_DEFS) \
SRC_LF = lfops.c lfsampling.c pcf7931.c lfdemod.c
SRC_ISO15693 = iso15693.c iso15693tools.c
SRC_ISO14443a = iso14443a.c mifareutil.c mifarecmd.c epa.c mifaresim.c thinfilm.c
SRC_ISO14443a = iso14443a.c mifareutil.c mifarecmd.c epa.c mifaresim.c
SRC_ISO14443b = iso14443b.c
SRC_FELICA = felica.c
SRC_CRAPTO1 = crypto1.c des.c desfire_key.c desfire_crypto.c mifaredesfire.c aes.c platform_util.c
SRC_CRC = crc.c crc16.c crc32.c
SRC_ICLASS = iclass.c optimized_cipher.c
SRC_LEGIC = legicrf.c legicrfsim.c legic_prng.c
SRC_NFCBARCODE = thinfilm.c
# SRC_BEE = bee.c
@ -114,6 +115,7 @@ THUMBSRC = start.c \
# These are to be compiled in ARM mode
ARMSRC = fpgaloader.c \
$(SRC_ISO14443a) \
$(SRC_NFCBARCODE) \
$(SRC_ISO14443b) \
$(SRC_CRAPTO1) \
$(SRC_ICLASS) \

View file

@ -527,6 +527,11 @@ void SendCapabilities(void) {
#else
capabilities.compiled_with_iclass = false;
#endif
#ifdef WITH_NFCBARCODE
capabilities.compiled_with_nfcbarcode = true;
#else
capabilities.compiled_with_nfcbarcode = false;
#endif
#ifdef WITH_LCD
capabilities.compiled_with_lcd = true;
#else
@ -1279,6 +1284,9 @@ static void PacketReceived(PacketCommandNG *packet) {
DetectNACKbug();
break;
}
#endif
#ifdef WITH_NFCBARCODE
case CMD_HF_THINFILM_READ: {
ReadThinFilm();
break;

View file

@ -213,9 +213,9 @@ static int CmdHfThinFilmList(const char *Cmd) {
static command_t CommandTable[] = {
{"help", CmdHelp, AlwaysAvailable, "This help"},
{"info", CmdHfThinFilmInfo, IfPm3Flash, "Tag information"},
{"list", CmdHfThinFilmList, AlwaysAvailable, "List ISO 14443A / Thinfilm history - not correct"},
{"sim", CmdHfThinFilmSim, IfPm3Flash, "Fake Thinfilm tag"},
{"info", CmdHfThinFilmInfo, IfPm3NfcBarcode, "Tag information"},
{"list", CmdHfThinFilmList, AlwaysAvailable, "List NFC Barcode / Thinfilm history - not correct"},
{"sim", CmdHfThinFilmSim, IfPm3NfcBarcode, "Fake Thinfilm tag"},
{NULL, NULL, NULL, NULL}
};

View file

@ -133,6 +133,12 @@ bool IfPm3Iclass(void) {
return pm3_capabilities.compiled_with_iclass;
}
bool IfPm3NfcBarcode(void) {
if (!IfPm3Present())
return false;
return pm3_capabilities.compiled_with_nfcbarcode;
}
bool IfPm3Lcd(void) {
if (!IfPm3Present())
return false;

View file

@ -38,6 +38,7 @@ bool IfPm3Iso15693(void);
bool IfPm3Felica(void);
bool IfPm3Legicrf(void);
bool IfPm3Iclass(void);
bool IfPm3NfcBarcode(void);
bool IfPm3Lcd(void);
// Print help for each command in the command array

View file

@ -111,8 +111,10 @@ PLATFORM_DEFS += \
-DWITH_ISO14443a \
-DWITH_ICLASS \
-DWITH_FELICA \
-DWITH_NFCBARCODE \
-DWITH_HFSNIFF
# Standalone mode
ifneq ($(strip $(filter $(PLATFORM_DEFS),$(STANDALONE_REQ_DEFS))),$(strip $(STANDALONE_REQ_DEFS)))
$(error Chosen Standalone mode $(STANDALONE) requires $(strip $(STANDALONE_REQ_DEFS)), unsupported by $(PLTNAME))

View file

@ -178,6 +178,7 @@ typedef struct {
bool compiled_with_felica : 1;
bool compiled_with_legicrf : 1;
bool compiled_with_iclass : 1;
bool compiled_with_nfcbarcode : 1;
// misc
bool compiled_with_lcd : 1;
@ -185,7 +186,7 @@ typedef struct {
bool hw_available_flash : 1;
bool hw_available_smartcard : 1;
} PACKED capabilities_t;
#define CAPABILITIES_VERSION 2
#define CAPABILITIES_VERSION 3
extern capabilities_t pm3_capabilities;
// For CMD_LF_T55XX_WRITEBL