12 #include "cmdlfviking.h"
14 static int CmdHelp(const char *Cmd
);
15 int CmdVikingDemod(const char *Cmd
)
18 if (param_gethex(Cmd
,0,id
,8) == 1)
20 PrintAndLog("Usage: lf viking demod <CardID 8 bytes of hex number>");
23 UsbCommand c
= {CMD_ACQUIRE_RAW_ADC_SAMPLES_125K
, {false,0,0}};
25 WaitForResponse(CMD_ACK
,NULL
);
26 getSamples("40000",true);
27 // try to demod AMViking
28 return AMVikingDemod(id
);
30 int CmdVikingClone(const char *Cmd
)
33 // get the tag number 64 bits (8 bytes) in hex
35 if (param_gethex(Cmd
,0,id
,16) == 1)
37 PrintAndLog("Usage: lf viking clone <Card ID 16 bytes of hex number>");
40 b1
= bytes_to_num(id
,sizeof(uint32_t));
41 b2
= bytes_to_num(id
+ sizeof(uint32_t),sizeof(uint32_t));
42 UsbCommand c
= {CMD_VIKING_CLONE_TAG
,{b1
,b2
}};
47 static command_t CommandTable
[] =
49 {"help", CmdHelp
, 1, "This help"},
50 {"demod",CmdVikingDemod
,1, "<8 digits tag id> -- Extract tag data"},
51 {"clone", CmdVikingClone
, 1, "<16 digits card data> clone viking tag"},
55 int CmdLFViking(const char *Cmd
)
57 CmdsParse(CommandTable
, Cmd
);
61 int CmdHelp(const char *Cmd
)
63 CmdsHelp(CommandTable
);