Skip to content

Commit

Permalink
Hook Sniff15693 App to the AutoCalibration command
Browse files Browse the repository at this point in the history
Signed-off-by: cacke-r <cresch@gmx.de>
  • Loading branch information
cacke-r committed Feb 23, 2022
1 parent 5f8d0ec commit 97d7ad8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
22 changes: 21 additions & 1 deletion Firmware/Chameleon-Mini/Application/Sniff15693.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,21 @@
#include "../Codec/SniffISO15693.h"
#include "Sniff15693.h"

Sniff15693Command Sniff15693CurrentCommand;

void SniffISO15693AppTimeout(void)
{
SniffISO15693AppReset();
}

void SniffISO15693AppInit(void)
{
Sniff15693CurrentCommand = Sniff15693_Do_Nothing;
}

void SniffISO15693AppReset(void)
{
SniffISO15693AppInit();
}


Expand All @@ -27,11 +36,22 @@ void SniffISO15693AppTask(void)
void SniffISO15693AppTick(void)
{


}

uint16_t SniffISO15693AppProcess(uint8_t* FrameBuf, uint16_t FrameBytes)
{
char str[64];
switch (Sniff15693CurrentCommand) {
case Sniff15693_Do_Nothing: {
return 0;
}
case Sniff15693_Autocalibrate: {
sprintf(str, "CMD: Sniff15693_Autocalibrate ");
LogEntry(LOG_INFO_GENERIC, str, strlen(str));
CommandLinePendingTaskFinished(COMMAND_INFO_FALSE_ID, NULL);
return 0;
}
}
return 0;
}

Expand Down
10 changes: 9 additions & 1 deletion Firmware/Chameleon-Mini/Application/Sniff15693.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SniffISO15693.h
* Sniff15693.h
*
* Created on: 05.11.2019
* Author: ceres-c
Expand All @@ -16,5 +16,13 @@ void SniffISO15693AppReset(void);
void SniffISO15693AppTask(void);
void SniffISO15693AppTick(void);
uint16_t SniffISO15693AppProcess(uint8_t* FrameBuf, uint16_t FrameBytes);
void SniffISO15693AppTimeout(void);

typedef enum {
Sniff15693_Do_Nothing,
Sniff15693_Autocalibrate,
} Sniff15693Command;

extern Sniff15693Command Sniff15693CurrentCommand;

#endif /* SNIFF_15693_H_ */
10 changes: 10 additions & 0 deletions Firmware/Chameleon-Mini/Terminal/Commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "../Battery.h"
#include "../Codec/Codec.h"
#include "../Application/Reader14443A.h"
#include "../Application/Sniff15693.h"

extern Reader14443Command Reader14443CurrentCommand;
extern Sniff14443Command Sniff14443CurrentCommand;
Expand Down Expand Up @@ -655,6 +656,15 @@ CommandStatusIdType CommandExecAutocalibrate(char *OutMessage) {
CommandLinePendingTaskTimeout = &Sniff14443AAppTimeout;
return TIMEOUT_COMMAND;
}
#endif
#ifdef CONFIG_ISO15693_SNIFF_SUPPORT
if (GlobalSettings.ActiveSettingPtr->Configuration == CONFIG_ISO15693_SNIFF) {
ApplicationReset();

Sniff15693CurrentCommand = Sniff15693_Autocalibrate;
CommandLinePendingTaskTimeout = &SniffISO15693AppTimeout;
return TIMEOUT_COMMAND;
}
#endif
return COMMAND_ERR_INVALID_USAGE_ID;
}
Expand Down

0 comments on commit 97d7ad8

Please sign in to comment.