- //throw away static - allow 1 and -1 (in case of threshold command first)\r
- if ( errCnt == -1 || bitlen < 16 ){ \r
- PrintAndLog("no data found");\r
- if (g_debugMode) \r
- PrintAndLog("errCnt: %d, bitlen: %d, clk: %d, invert: %d", errCnt, bitlen, clk, invert);\r
- return 3;\r
+ if (CmdDetectClockRate("f")){ //wave is almost certainly FSK\r
+ // FSK\r
+ if ( FSKrawDemod("0 0", FALSE) && test())\r
+ printT55xx("FSK");\r
+ // FSK inverted\r
+ if ( FSKrawDemod("0 1", FALSE) && test()) \r
+ printT55xx("FSK inv");\r
+ } else {\r
+ // ASK/MAN (autoclock, normal, maxerrors 1)\r
+ if ( ASKmanDemod("0 0 1", FALSE, FALSE) && test()) \r
+ printT55xx("ASK/MAN");\r
+ \r
+ // ASK/MAN (autoclock, inverted, maxerrors 1)\r
+ if ( ASKmanDemod("0 1 1", FALSE, FALSE) && test()) \r
+ printT55xx("ASK/MAN Inv");\r
+\r
+ // NZR (autoclock, normal, maxerrors 1)\r
+ if ( NRZrawDemod("0 0 1", FALSE) && test()) \r
+ printT55xx("NZR");\r
+ // NZR (autoclock, inverted, maxerrors 1)\r
+ if ( NRZrawDemod("0 1 1", FALSE) && test()) \r
+ printT55xx("NZR inv");\r
+ \r
+ // PSK (autoclock, normal, maxerrors 1)\r
+ if ( PSKDemod("0 0 1", FALSE) && test()) \r
+ printT55xx("PSK");\r
+\r
+ // PSK (autoclock, inverted, maxerrors 1)\r
+ if ( PSKDemod("0 1 1", FALSE) && test()) \r
+ printT55xx("PSK inv");\r
+ \r
+ //PSK2?\r
+ \r
+ // if (!BiphaseRawDecode("0",FALSE) && test()) \r
+ // printT55xx("BIPHASE");\r
+ \r
+ // if (!BiphaseRawDecode("1",FALSE) && test()) \r
+ // printT55xx("BIPHASE inv");\r