Skip to content

Commit

Permalink
Disabled sniff/reader codecs compilation
Browse files Browse the repository at this point in the history
Had to make some minor changes to Commands.c and CommandLine.c
to allow building without these codecs
  • Loading branch information
ceres-c committed Oct 15, 2020
1 parent bc3ae6b commit 9c135cd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
14 changes: 7 additions & 7 deletions Firmware/Chameleon-Mini/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ SETTINGS += -DCONFIG_MF_CLASSIC_1K_7B_SUPPORT
SETTINGS += -DCONFIG_MF_CLASSIC_4K_SUPPORT
SETTINGS += -DCONFIG_MF_CLASSIC_4K_7B_SUPPORT
SETTINGS += -DCONFIG_MF_ULTRALIGHT_SUPPORT
SETTINGS += -DCONFIG_ISO14443A_SNIFF_SUPPORT
SETTINGS += -DCONFIG_ISO14443A_READER_SUPPORT
SETTINGS += -DCONFIG_VICINITY_SUPPORT
SETTINGS += -DCONFIG_SL2S2002_SUPPORT
SETTINGS += -DCONFIG_TITAGITSTANDARD_SUPPORT
SETTINGS += -DCONFIG_ISO15693_SNIFF_SUPPORT
SETTINGS += -DCONFIG_EM4233_SUPPORT
# SETTINGS += -DCONFIG_ISO14443A_SNIFF_SUPPORT
# SETTINGS += -DCONFIG_ISO14443A_READER_SUPPORT
SETTINGS += -DCONFIG_VICINITY_SUPPORT
SETTINGS += -DCONFIG_SL2S2002_SUPPORT
SETTINGS += -DCONFIG_TITAGITSTANDARD_SUPPORT
# SETTINGS += -DCONFIG_ISO15693_SNIFF_SUPPORT
SETTINGS += -DCONFIG_EM4233_SUPPORT

#Support magic mode on mifare classic configuration
SETTINGS += -DSUPPORT_MF_CLASSIC_MAGIC_MODE
Expand Down
4 changes: 4 additions & 0 deletions Firmware/Chameleon-Mini/Terminal/CommandLine.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ const PROGMEM CommandEntryType CommandTable[] = {
.SetFunc = NO_FUNCTION,
.GetFunc = CommandGetSysTick
},
#ifdef CONFIG_ISO14443A_READER_SUPPORT
{
.Command = COMMAND_SEND_RAW,
.ExecFunc = NO_FUNCTION,
Expand Down Expand Up @@ -302,6 +303,7 @@ const PROGMEM CommandEntryType CommandTable[] = {
.SetFunc = NO_FUNCTION,
.GetFunc = NO_FUNCTION
},
#endif
{
.Command = COMMAND_TIMEOUT,
.ExecFunc = NO_FUNCTION,
Expand Down Expand Up @@ -330,13 +332,15 @@ const PROGMEM CommandEntryType CommandTable[] = {
.SetFunc = CommandSetField,
.GetFunc = CommandGetField
},
#ifdef CONFIG_ISO14443A_READER_SUPPORT
{
.Command = COMMAND_CLONE,
.ExecFunc = CommandExecClone,
.ExecParamFunc = NO_FUNCTION,
.SetFunc = NO_FUNCTION,
.GetFunc = NO_FUNCTION
},
#endif
{
.Command = COMMAND_SETUIDMODE,
.ExecFunc = NO_FUNCTION,
Expand Down
15 changes: 11 additions & 4 deletions Firmware/Chameleon-Mini/Terminal/Commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ CommandStatusIdType CommandGetSysTick(char *OutParam) {
return COMMAND_INFO_OK_WITH_TEXT_ID;
}

#ifdef CONFIG_ISO14443A_READER_SUPPORT
CommandStatusIdType CommandExecParamSend(char *OutMessage, const char *InParams) {
if (GlobalSettings.ActiveSettingPtr->Configuration != CONFIG_ISO14443A_READER)
return COMMAND_ERR_INVALID_USAGE_ID;
Expand Down Expand Up @@ -583,6 +584,7 @@ CommandStatusIdType CommandExecIdentifyCard(char *OutMessage) {
CommandLinePendingTaskTimeout = &Reader14443AAppTimeout;
return TIMEOUT_COMMAND;
}
#endif

CommandStatusIdType CommandGetTimeout(char *OutParam) {
snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("%u ms"), GlobalSettings.ActiveSettingPtr->PendingTaskTimeout * 100);
Expand Down Expand Up @@ -647,6 +649,7 @@ CommandStatusIdType CommandGetField(char *OutMessage) {


CommandStatusIdType CommandExecAutocalibrate(char *OutMessage) {
#ifdef CONFIG_ISO14443A_READER_SUPPORT
if (GlobalSettings.ActiveSettingPtr->Configuration == CONFIG_ISO14443A_READER) {
ApplicationReset();

Expand All @@ -655,19 +658,22 @@ CommandStatusIdType CommandExecAutocalibrate(char *OutMessage) {
Reader14443ACodecStart();
CommandLinePendingTaskTimeout = &Reader14443AAppTimeout;
return TIMEOUT_COMMAND;
} else if (GlobalSettings.ActiveSettingPtr->Configuration == CONFIG_ISO14443A_SNIFF) {
}
#endif
#ifdef CONFIG_ISO14443A_SNIFF_SUPPORT
if (GlobalSettings.ActiveSettingPtr->Configuration == CONFIG_ISO14443A_SNIFF) {
ApplicationReset();

Sniff14443CurrentCommand = Sniff14443_Autocalibrate;
Sniff14443AAppInit();
CommandLinePendingTaskTimeout = &Sniff14443AAppTimeout;
return TIMEOUT_COMMAND;
} else {
return COMMAND_ERR_INVALID_USAGE_ID;
}

#endif
return COMMAND_ERR_INVALID_USAGE_ID;
}

#ifdef CONFIG_ISO14443A_READER_SUPPORT
CommandStatusIdType CommandExecClone(char *OutMessage) {
ConfigurationSetById(CONFIG_ISO14443A_READER);

Expand All @@ -680,6 +686,7 @@ CommandStatusIdType CommandExecClone(char *OutMessage) {

return TIMEOUT_COMMAND;
}
#endif

extern uint32_t dwBaudRate;
CommandStatusIdType CommandGetBaudrate(char *OutParam) {
Expand Down

0 comments on commit 9c135cd

Please sign in to comment.