mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
mix->ng
This commit is contained in:
parent
3776b2ed6b
commit
d6e3366c43
2 changed files with 25 additions and 9 deletions
|
@ -954,7 +954,11 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
break;
|
||||
}
|
||||
case CMD_LF_COTAG_READ: {
|
||||
Cotag(packet->oldarg[0]);
|
||||
struct p {
|
||||
uint8_t mode;
|
||||
} PACKED;
|
||||
struct p *payload = (struct p *)packet->data.asBytes;
|
||||
Cotag(payload->mode);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -82,21 +82,33 @@ static int CmdCOTAGDemod(const char *Cmd) {
|
|||
// 2 = raw signal - maxlength bigbuff
|
||||
static int CmdCOTAGRead(const char *Cmd) {
|
||||
|
||||
if (tolower(Cmd[0]) == 'h') return usage_lf_cotag_read();
|
||||
if (tolower(Cmd[0]) == 'h')
|
||||
return usage_lf_cotag_read();
|
||||
|
||||
uint32_t rawsignal = 1;
|
||||
sscanf(Cmd, "%u", &rawsignal);
|
||||
struct p {
|
||||
uint8_t mode;
|
||||
} PACKED payload;
|
||||
payload.mode = param_get8ex(Cmd, 0, 1, 10);
|
||||
|
||||
PacketResponseNG resp;
|
||||
clearCommandBuffer();
|
||||
SendCommandMIX(CMD_LF_COTAG_READ, rawsignal, 0, 0, NULL, 0);
|
||||
SendCommandNG(CMD_LF_COTAG_READ, (uint8_t*)&payload, sizeof(payload));
|
||||
|
||||
if (!WaitForResponseTimeout(CMD_LF_COTAG_READ, &resp, 7000)) {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
return PM3_ETIMEOUT;
|
||||
uint8_t timeout = 3;
|
||||
while (!WaitForResponseTimeout(CMD_LF_COTAG_READ, &resp, 2000)) {
|
||||
timeout--;
|
||||
printf(".");
|
||||
fflush(stdout);
|
||||
|
||||
if (timeout == 0) {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
}
|
||||
if (timeout != 3)
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
|
||||
switch (rawsignal) {
|
||||
switch (payload.mode) {
|
||||
case 0:
|
||||
case 2: {
|
||||
CmdPlot("");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue