#include "cmdlf.h"\r
#include "cmdlft55xx.h"\r
#include "util.h"\r
-#include "data.h"\r
#include "lfdemod.h"\r
#include "cmdhf14a.h" //for getTagInfo\r
#include "protocols.h"\r
cmdp+=2;\r
break;\r
case 'd':\r
- param_getstr(Cmd, cmdp+1, modulation);\r
+ param_getstr(Cmd, cmdp+1, modulation, sizeof(modulation));\r
cmdp += 2;\r
\r
if ( strcmp(modulation, "FSK" ) == 0) {\r
break;\r
case DEMOD_PSK1:\r
// skip first 160 samples to allow antenna to settle in (psk gets inverted occasionally otherwise)\r
- save_restoreGB(1);\r
+ save_restoreGB(GRAPH_SAVE);\r
CmdLtrim("160");\r
snprintf(cmdStr, sizeof(buf),"%d %d 6", bitRate[config.bitrate], config.inverted );\r
ans = PSKDemod(cmdStr, false);\r
//undo trim samples\r
- save_restoreGB(0);\r
+ save_restoreGB(GRAPH_RESTORE);\r
break;\r
case DEMOD_PSK2: //inverted won't affect this\r
case DEMOD_PSK3: //not fully implemented\r
// skip first 160 samples to allow antenna to settle in (psk gets inverted occasionally otherwise)\r
- save_restoreGB(1);\r
+ save_restoreGB(GRAPH_SAVE);\r
CmdLtrim("160");\r
snprintf(cmdStr, sizeof(buf),"%d 0 6", bitRate[config.bitrate] );\r
ans = PSKDemod(cmdStr, false);\r
psk1TOpsk2(DemodBuffer, DemodBufferLen);\r
//undo trim samples\r
- save_restoreGB(0);\r
+ save_restoreGB(GRAPH_RESTORE);\r
break;\r
case DEMOD_NRZ:\r
snprintf(cmdStr, sizeof(buf),"%d %d 1", bitRate[config.bitrate], config.inverted );\r
clk = GetPskClock("", false, false);\r
if (clk>0) {\r
// allow undo\r
- save_restoreGB(1);\r
+ save_restoreGB(GRAPH_SAVE);\r
// skip first 160 samples to allow antenna to settle in (psk gets inverted occasionally otherwise)\r
CmdLtrim("160");\r
if ( PSKDemod("0 0 6", false) && test(DEMOD_PSK1, &tests[hits].offset, &bitRate, clk, &tests[hits].Q5)) {\r
}\r
} // inverse waves does not affect this demod\r
//undo trim samples\r
- save_restoreGB(0);\r
+ save_restoreGB(GRAPH_RESTORE);\r
}\r
} \r
if ( hits == 1) {\r
}\r
\r
uint8_t got[BIGBUF_SIZE-1];\r
- GetFromBigBuf(got,sizeof(got),0);\r
- WaitForResponse(CMD_ACK,NULL);\r
+ GetFromBigBuf(got, sizeof(got), 0, NULL, -1 , 0);\r
setGraphBuf(got, sizeof(got));\r
return 1;\r
}\r
//The line start with # is comment, skip\r
if( buf[0]=='#' ) continue;\r
\r
- if (!isxdigit(buf[0])) {\r
+ if (!isxdigit((unsigned char)buf[0])) {\r
PrintAndLog("File content error. '%s' must include 8 HEX symbols", buf);\r
continue;\r
}\r