]>
git.zerfleddert.de Git - proxmark3-svn/blob - client/cmdlfio.c
11 #include "cmdparser.h"
16 static int CmdHelp(const char *Cmd
);
18 int CmdIODemodFSK(const char *Cmd
)
21 if(Cmd
[0]=='1') findone
=1;
22 UsbCommand c
={CMD_IO_DEMOD_FSK
};
29 int CmdIOProxDemod(const char *Cmd
){
30 if (GraphTraceLen
< 4800) {
31 PrintAndLog("too short; need at least 4800 samples");
36 for (int i
= 0; i
< GraphTraceLen
; ++i
) {
37 if (GraphBuffer
[i
] < 0) {
47 int CmdIOClone(const char *Cmd
)
49 unsigned int hi
= 0, lo
= 0;
54 //if (1 == sscanf(str, "0x%"SCNx32, &hi)) {
55 // value now contains the value in the string--decimal 255, in this case.
58 while (sscanf(&Cmd
[i
++], "%1x", &n
) == 1) {
59 hi
= (hi
<< 4) | (lo
>> 28);
60 lo
= (lo
<< 4) | (n
& 0xf);
63 PrintAndLog("Cloning tag with ID %08x %08x", hi
, lo
);
65 c
.cmd
= CMD_IO_CLONE_TAG
;
73 static command_t CommandTable
[] =
75 {"help", CmdHelp
, 1, "This help"},
76 {"demod", CmdIOProxDemod
, 1, "Demodulate Stream"},
77 {"fskdemod", CmdIODemodFSK
, 0, "['1'] Realtime IO FSK demodulator (option '1' for one tag only)"},
78 {"clone", CmdIOClone
, 0, "Clone ioProx Tag"},
82 int CmdLFIO(const char *Cmd
)
84 CmdsParse(CommandTable
, Cmd
);
88 int CmdHelp(const char *Cmd
)
90 CmdsHelp(CommandTable
);