]>
Commit | Line | Data |
---|---|---|
4653da43 | 1 | //----------------------------------------------------------------------------- |
2 | // Authored by Iceman | |
3 | // | |
4 | // This code is licensed to you under the terms of the GNU GPL, version 2 or, | |
5 | // at your option, any later version. See the LICENSE.txt file for the text of | |
6 | // the license. | |
7 | //----------------------------------------------------------------------------- | |
8 | // Low frequency COTAG commands | |
9 | //----------------------------------------------------------------------------- | |
10 | #include "cmdlfcotag.h" // COTAG function declarations | |
11 | ||
12 | static int CmdHelp(const char *Cmd); | |
13 | ||
14 | int CmdCOTAGRead(const char *Cmd) { | |
15 | ||
16 | // if (Cmd[0] == 'h' || Cmd[0] == 'H') return usage_lf_cotag_read(); | |
17 | ||
18 | UsbCommand c = {CMD_COTAG, {0, 0, 0}}; | |
19 | clearCommandBuffer(); | |
20 | SendCommand(&c); | |
b828a4e1 | 21 | if ( !WaitForResponseTimeout(CMD_ACK, NULL, 2500) ) { |
bdf387c7 | 22 | PrintAndLog("command execution time out"); |
b828a4e1 | 23 | return 1; |
24 | } | |
bdf387c7 | 25 | getSamples("20000", true); |
b828a4e1 | 26 | return 0; |
4653da43 | 27 | } |
28 | ||
29 | static command_t CommandTable[] = { | |
30 | {"help", CmdHelp, 1, "This help"}, | |
31 | {"read", CmdCOTAGRead, 0, "Attempt to read and extract tag data"}, | |
32 | {NULL, NULL, 0, NULL} | |
33 | }; | |
34 | ||
35 | int CmdLFCOTAG(const char *Cmd) { | |
36 | clearCommandBuffer(); | |
37 | CmdsParse(CommandTable, Cmd); | |
38 | return 0; | |
39 | } | |
40 | ||
41 | int CmdHelp(const char *Cmd) { | |
42 | CmdsHelp(CommandTable); | |
43 | return 0; | |
44 | } |