-/*\r
-FSK1 / FSK1a\r
-size = fskdemod(dest, size, 32, 0, 8, 10); // fsk1 RF/32 \r
-size = fskdemod(dest, size, 32, 1, 8, 10); // fsk1a RF/32 \r
-\r
-FSK2 / FSK2a\r
-size = fskdemod(dest, size, 32, 0, 10, 8); // fsk2 RF/32 \r
-size = fskdemod(dest, size, 32, 1, 10, 8); // fsk2a RF/32 \r
-size = fskdemod(dest, size, 50, 1, 10, 8); // fsk2a RF/50 \r
-size = fskdemod(dest, size, 64, 1, 10, 8); // FSK2a RF/64 \r
-\r
-PSK1\r
-errCnt = pskRawDemod(bits, &bitlen, 32, 0);\r
-*/\r
-bool tryDemod(uint8_t bits[], size_t bitlen) {\r
- \r
- int invert = 0;\r
- int clk = 0;\r
- int errCnt, size;\r
- int maxErr = 100;\r
- uint8_t rflen, fchigh, fclow, dummy = 0;\r
- uint16_t fcs=0;\r
-\r
- // ASK - manchester demod\r
- errCnt = askmandemod(bits, &bitlen, &clk, &invert, maxErr);\r
- if ( analyseDemod(errCnt, bitlen, clk, invert) ) \r
- return true;\r
-\r
- // FSK demod\r
- fcs = countFC(bits, bitlen, &dummy);\r
- if (fcs == 0){\r
- fchigh = 10;\r
- fclow = 8;\r
- }else{\r
- fchigh = (fcs >> 8) & 0xFF;\r
- fclow = fcs & 0xFF;\r
+ if ( NRZrawDemod("0 1 1", FALSE) && test()) {\r
+ tests[hits].modulation = DEMOD_NZR;\r
+ tests[hits].inversed = TRUE;\r
+ ++hits;\r
+ }\r
+ \r
+ if ( PSKDemod("0 0 1", FALSE) >= 0 && test()) {\r
+ tests[hits].modulation = DEMOD_PSK;\r
+ tests[hits].inversed = FALSE;\r
+ ++hits;\r
+ }\r
+ \r
+ if ( PSKDemod("0 1 1", FALSE) >= 0 && test()) {\r
+ tests[hits].modulation = DEMOD_PSK;\r
+ tests[hits].inversed = TRUE;\r
+ ++hits;\r
+ }\r
+ //PSK2?\r
+ // if (!BiphaseRawDecode("0",FALSE) && test()) {\r
+ // tests[++hits].modulation = DEMOD_BI;\r
+ // tests[hits].inversed = FALSE;\r
+ //}\r
+ // if (!BiphaseRawDecode("1",FALSE) && test()) {\r
+ // tests[++hits].modulation = DEMOD_BI;\r
+ // tests[hits].inversed = TRUE;\r
+ // }\r
+ } \r
+ if ( hits == 1) {\r
+ config.modulation = tests[0].modulation;\r
+ config.inversed = tests[0].inversed;\r
+ printConfiguration( config );\r
+ return TRUE;\r