PrintAndLog("FSK decoded bitstream:");
printBitStream(BitStream,size);
}
+
return 1;
} else{
if (verbose) PrintAndLog("no FSK data found");
}
uint8_t BitStream[MAX_GRAPH_TRACE_LEN]={0};
size_t BitLen = getFromGraphBuf(BitStream);
- if (BitLen==0) return 0;
+ if (BitLen==0) return -1;
+ uint8_t carrier=countPSK_FC(BitStream, BitLen);
+ if (carrier!=2 && carrier!=4 || carrier!=8){
+ //invalid carrier
+ return -1
+ }
int errCnt=0;
- errCnt = pskRawDemod(BitStream, &BitLen,&clk,&invert);
+ errCnt = pskRawDemod(BitStream, &BitLen, &clk, &invert);
if (errCnt > maxErr){
if (g_debugMode==1 && verbose) PrintAndLog("Too many errors found, clk: %d, invert: %d, numbits: %d, errCnt: %d",clk,invert,BitLen,errCnt);
return -1;
PrintAndLog(" : data psk2rawdemod 64 1 0 = demod a psk2 tag from GraphBuffer using a clock of RF/64, inverting output and allowing 0 demod errors");
return 0;
}
- errCnt=PSKDemod(Cmd, 1);
+ errCnt=PSKDemod(Cmd, TRUE);
if (errCnt<0){
if (g_debugMode) PrintAndLog("Error demoding: %d",errCnt);
return 0;