lf em stuff
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "cmdhw.h"
|
||||
#include "cmddata.h"
|
||||
#include "commonutil.h"
|
||||
#include "pm3_cmd.h"
|
||||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
@@ -516,6 +517,32 @@ static int CmdStatus(const char *Cmd) {
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
int handle_tearoff(tearoff_params_t *params, bool verbose) {
|
||||
|
||||
if (params == NULL)
|
||||
return PM3_EINVARG;
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_SET_TEAROFF, (uint8_t *)params, sizeof(tearoff_params_t));
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_SET_TEAROFF, &resp, 500) == false) {
|
||||
PrintAndLogEx(WARNING, "Tear-off command timeout.");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
||||
if (resp.status == PM3_SUCCESS) {
|
||||
if (params->delay_us > 0 && verbose)
|
||||
PrintAndLogEx(INFO, "Tear-off hook configured with delay of " _GREEN_("%i us"), params->delay_us);
|
||||
|
||||
if (params->on && verbose)
|
||||
PrintAndLogEx(INFO, "Tear-off hook " _GREEN_("enabled"));
|
||||
|
||||
if (params->off && verbose)
|
||||
PrintAndLogEx(INFO, "Tear-off hook " _RED_("disabled"));
|
||||
}
|
||||
return resp.status;
|
||||
}
|
||||
|
||||
static int CmdTearoff(const char *Cmd) {
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "hw tearoff",
|
||||
|
||||
Reference in New Issue
Block a user