X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/28fdb04fd8d62e46c36f959b373d662f1a146448..7bd30f12ac6def96c82df20ed7d927160db289af:/client/cmdhf15.c diff --git a/client/cmdhf15.c b/client/cmdhf15.c index ec898755..55a33de7 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -33,7 +33,7 @@ #include "ui.h" #include "cmdparser.h" #include "cmdhf15.h" -#include "iso15693tools.h" +#include "../common/iso15693tools.h" #include "cmdmain.h" #define FrameSOF Iso15693FrameSOF @@ -44,8 +44,7 @@ #define Crc(data,datalen) Iso15693Crc(data,datalen) #define AddCrc(data,datalen) Iso15693AddCrc(data,datalen) #define sprintUID(target,uid) Iso15693sprintUID(target,uid) - -static int CmdHelp(const char *Cmd); +#define TRACE_BUFF_SIZE 12000 // structure and database for uid -> tagtype lookups typedef struct { @@ -254,6 +253,17 @@ int CmdHF15Read(const char *Cmd) { UsbCommand c = {CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693}; SendCommand(&c); + + uint8_t data[TRACE_BUFF_SIZE] = {0x00}; + + GetFromBigBuf(data,TRACE_BUFF_SIZE,3560); //3560 -- should be offset.. + WaitForResponseTimeout(CMD_ACK,NULL, 1500); + + for (int j = 0; j < TRACE_BUFF_SIZE; j++) { + GraphBuffer[j] = ((int)data[j]) ; + } + GraphTraceLen = TRACE_BUFF_SIZE; + RepaintGraphWindow(); return 0; } @@ -262,6 +272,17 @@ int CmdHF15Record(const char *Cmd) { UsbCommand c = {CMD_RECORD_RAW_ADC_SAMPLES_ISO_15693}; SendCommand(&c); + + uint8_t data[TRACE_BUFF_SIZE] = {0x00}; + + GetFromBigBuf(data,TRACE_BUFF_SIZE,3560); //3560 -- should be offset.. + WaitForResponseTimeout(CMD_ACK,NULL, 1500); + + for (int j = 0; j < TRACE_BUFF_SIZE; j++) { + GraphBuffer[j] = ((int)data[j]) ; + } + GraphTraceLen = TRACE_BUFF_SIZE; + RepaintGraphWindow(); return 0; } @@ -328,7 +349,7 @@ int CmdHF15DumpMem(const char*Cmd) { *output=0; // reset outputstring sprintf(output, "Block %2i ",blocknum); for ( int i=1; i"); - PrintAndLog(" 0..no debugging output 1..turn debugging on"); + PrintAndLog("Usage: hf 15 cmd debug <0|1>"); + PrintAndLog(" 0 no debugging"); + PrintAndLog(" 1 turn debugging on"); return 0; } @@ -516,7 +538,7 @@ int CmdHF15CmdRaw (const char *cmd) { hexout = (char *)malloc(resp.arg[0] * 3 + 1); if (hexout != NULL) { for (int i = 0; i < resp.arg[0]; i++) { // data in hex - sprintf(&hexout[i * 3], "%02hX ", recv[i]); + sprintf(&hexout[i * 3], "%02X ", recv[i]); } PrintAndLog("%s", hexout); free(hexout); @@ -669,7 +691,7 @@ int CmdHF15CmdSysinfo(const char *Cmd) { if (!(recv[0] & ISO15_RES_ERROR)) { *output=0; // reset outputstring for ( i=1; i