- \r
- bitlen = getFromGraphBuf(bits);\r
-\r
- int ans = 0;\r
- ans = CmdFSKrawdemod("");\r
- ans = CmdFSKrawdemod("1"); //invert?\r
- ans = Cmdaskmandemod("");\r
- ans = Cmdaskrawdemod("");\r
- ans = CmdNRZrawDemod("");\r
- ans = CmdPSK1rawDemod("");\r
- ans = CmdPSK2rawDemod("");\r
+\r
+ if (block == 0){\r
+ // try a detection. \r
+ }\r
+ \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
+ }\r
+ return 0;\r
+}\r
+bool test(){\r
+\r
+ if ( !DemodBufferLen) \r
+ return false;\r