CHG: minor text changes.

CHG: cmd+2, to skip first inparameter in string.
This commit is contained in:
iceman1001 2015-04-02 12:08:57 +02:00
commit b3a8c87d5c

View file

@ -414,10 +414,7 @@ int ASKmanDemod(const char *Cmd, bool verbose, bool emSearch)
int invert=0; int invert=0;
int clk=0; int clk=0;
int maxErr=100; int maxErr=100;
//param_getdec(Cmd, 0, &clk);
//param_getdec(Cmd, 1, &invert);
//maxErr = param_get32ex(Cmd, 2, 0xFFFFFFFF, 10);
//if (maxErr == 0xFFFFFFFF) maxErr=100;
uint8_t BitStream[MAX_GRAPH_TRACE_LEN]={0}; uint8_t BitStream[MAX_GRAPH_TRACE_LEN]={0};
sscanf(Cmd, "%i %i %i", &clk, &invert, &maxErr); sscanf(Cmd, "%i %i %i", &clk, &invert, &maxErr);
if (invert != 0 && invert != 1) { if (invert != 0 && invert != 1) {
@ -429,20 +426,23 @@ int ASKmanDemod(const char *Cmd, bool verbose, bool emSearch)
clk=0; clk=0;
} }
size_t BitLen = getFromGraphBuf(BitStream); size_t BitLen = getFromGraphBuf(BitStream);
if (g_debugMode==1) PrintAndLog("DEBUG: Bitlen from grphbuff: %d",BitLen); if (g_debugMode) PrintAndLog("DEBUG: Bitlen from graphbuffer: %d",BitLen);
if (BitLen==0) return 0; if (BitLen==0) return 0;
int errCnt=0;
errCnt = askmandemod(BitStream, &BitLen, &clk, &invert, maxErr); int errCnt = askmandemod(BitStream, &BitLen, &clk, &invert, maxErr);
if (errCnt<0||BitLen<16){ //if fatal error (or -1) if (errCnt<0||BitLen<16){ //if fatal error (or -1)
if (g_debugMode==1) PrintAndLog("no data found %d, errors:%d, bitlen:%d, clock:%d",errCnt,invert,BitLen,clk); if (g_debugMode) PrintAndLog("DEBUG: no data found %d, errors:%d, bitlen:%d, clock:%d",errCnt,invert,BitLen,clk);
return 0; return 0;
} }
if (verbose || g_debugMode) PrintAndLog("\nUsing Clock: %d - Invert: %d - Bits Found: %d",clk,invert,BitLen); if (verbose || g_debugMode) PrintAndLog("\nUsing Clock: %d - Invert: %d - Bits Found: %d",clk,invert,BitLen);
//output
if (errCnt>0){ if (errCnt>0){
if (verbose || g_debugMode) PrintAndLog("# Errors during Demoding (shown as 77 in bit stream): %d",errCnt); if (verbose || g_debugMode) PrintAndLog("DEBUG: Errors during Demoding (shown as 77 in bit stream): %d",errCnt);
} }
if (verbose || g_debugMode) PrintAndLog("ASK/Manchester decoded bitstream:"); if (verbose || g_debugMode) PrintAndLog("ASK/Manchester decoded bitstream:");
// Now output the bitstream to the scrollback by line of 16 bits // Now output the bitstream to the scrollback by line of 16 bits
setDemodBuf(BitStream,BitLen,0); setDemodBuf(BitStream,BitLen,0);
@ -680,7 +680,7 @@ int ASKbiphaseDemod(const char *Cmd, bool verbose)
ans = sscanf(Cmd, "%i %i %i %i", &offset, &clk, &invert, &maxErr); ans = sscanf(Cmd, "%i %i %i %i", &offset, &clk, &invert, &maxErr);
if (ans>0) if (ans>0)
ans = ASKrawDemod(Cmd+1, FALSE); ans = ASKrawDemod(Cmd+2, FALSE);
else else
ans = ASKrawDemod(Cmd, FALSE); ans = ASKrawDemod(Cmd, FALSE);
if (!ans) { if (!ans) {