mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-19 21:03:23 -07:00
fix occasional strange printed clock value with...
...fskdemod Fix Q5 tag detection in lf t55xx detect Fix param_get8 reversed parameters
This commit is contained in:
parent
2c7928874b
commit
6ca1477c74
3 changed files with 19 additions and 22 deletions
|
@ -944,35 +944,32 @@ int FSKrawDemod(const char *Cmd, bool verbose)
|
|||
{
|
||||
//raw fsk demod no manchester decoding no start bit finding just get binary from wave
|
||||
uint8_t rfLen, invert, fchigh, fclow;
|
||||
|
||||
//set defaults
|
||||
//set options from parameters entered with the command
|
||||
rfLen = param_get8ex(Cmd, 0, 0, 10);
|
||||
invert = param_get8ex(Cmd, 1, 0, 10);
|
||||
fchigh = param_get8ex(Cmd, 2, 0, 10);
|
||||
fclow = param_get8ex(Cmd, 3, 0, 10);
|
||||
|
||||
rfLen = param_get8(Cmd, 0);
|
||||
invert = param_get8(Cmd, 1);
|
||||
fchigh = param_get8(Cmd, 2);
|
||||
fclow = param_get8(Cmd, 3);
|
||||
if (strlen(Cmd)>0 && strlen(Cmd)<=2) {
|
||||
if (rfLen==1){
|
||||
invert = 1; //if invert option only is used
|
||||
rfLen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t BitStream[MAX_GRAPH_TRACE_LEN]={0};
|
||||
size_t BitLen = getFromGraphBuf(BitStream);
|
||||
if (BitLen==0) return 0;
|
||||
//get field clock lengths
|
||||
uint16_t fcs=0;
|
||||
uint8_t fc1=0, fc2=0, rf1=0;
|
||||
if (!fchigh || !fclow) {
|
||||
fcs = countFC(BitStream, BitLen, 1);
|
||||
if (!fcs) {
|
||||
fchigh = 10;
|
||||
fclow = 8;
|
||||
} else {
|
||||
fchigh = (fcs >> 8) & 0x00FF;
|
||||
fclow = fcs & 0x00FF;
|
||||
uint8_t ans = fskClocks(&fc1, &fc2, &rf1, false);
|
||||
if (ans == 0) {
|
||||
if (g_debugMode) PrintAndLog("\nError: cannot detect valid fsk field clocks");
|
||||
return 0; // can't detect field clock
|
||||
}
|
||||
fchigh = fc1;
|
||||
fclow = fc2;
|
||||
if (rfLen == 0) rfLen = rf1;
|
||||
}
|
||||
//get bit clock length
|
||||
if (!rfLen){
|
||||
|
@ -985,7 +982,7 @@ int FSKrawDemod(const char *Cmd, bool verbose)
|
|||
|
||||
// Now output the bitstream to the scrollback by line of 16 bits
|
||||
if (verbose || g_debugMode) {
|
||||
PrintAndLog("\nUsing Clock:%u, invert:%u, fchigh:%u, fclow:%u", rfLen, invert, fchigh, fclow);
|
||||
PrintAndLog("\nUsing Clock:%d, invert:%d, fchigh:%d, fclow:%d", rfLen, invert, fchigh, fclow);
|
||||
PrintAndLog("%s decoded bitstream:",GetFSKType(fchigh,fclow,invert));
|
||||
printDemodBuff();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue