uint8_t bitRate = 0;\r
uint8_t rates[9] = {8,16,32,40,50,64,100,128,0};\r
uint8_t cmdp = 0;\r
- config.Q5 = FALSE;\r
bool errors = FALSE;\r
while(param_getchar(Cmd, cmdp) != 0x00 && !errors)\r
{\r
return FALSE;\r
}\r
\r
+int convertQ5bitRate(uint8_t bitRateRead) {\r
+ uint8_t expected[] = {8, 16, 32, 40, 50, 64, 100, 128};\r
+ for (int i=0; i<8; i++)\r
+ if (expected[i] == bitRateRead)\r
+ return i;\r
+\r
+ return -1;\r
+}\r
+\r
bool testQ5(uint8_t mode, uint8_t *offset, int *fndBitRate, uint8_t clk){\r
\r
if ( DemodBufferLen < 64 ) return FALSE;\r
//test modulation\r
if (!testQ5Modulation(mode, modread)) continue;\r
if (bitRate != clk) continue;\r
- *fndBitRate = bitRate;\r
+ *fndBitRate = convertQ5bitRate(bitRate);\r
+ if (*fndBitRate < 0) continue;\r
*offset = idx;\r
\r
return TRUE;\r
return 1;\r
}\r
\r
-char * GetBitRateStr(uint32_t id){\r
- static char buf[25];\r
+char * GetBitRateStr(uint32_t id) {\r
+ static char buf[25];\r
\r
char *retStr = buf;\r
- switch (id){\r
- case 0: \r
- snprintf(retStr,sizeof(buf),"%d - RF/8",id);\r
- break;\r
- case 1:\r
- snprintf(retStr,sizeof(buf),"%d - RF/16",id);\r
- break;\r
- case 2: \r
- snprintf(retStr,sizeof(buf),"%d - RF/32",id);\r
- break;\r
- case 3:\r
- snprintf(retStr,sizeof(buf),"%d - RF/40",id);\r
- break;\r
- case 4:\r
- snprintf(retStr,sizeof(buf),"%d - RF/50",id);\r
- break;\r
- case 5:\r
- snprintf(retStr,sizeof(buf),"%d - RF/64",id);\r
- break;\r
- case 6:\r
- snprintf(retStr,sizeof(buf),"%d - RF/100",id);\r
- break;\r
- case 7:\r
- snprintf(retStr,sizeof(buf),"%d - RF/128",id);\r
- break;\r
- default:\r
- snprintf(retStr,sizeof(buf),"%d - (Unknown)",id);\r
- break;\r
- }\r
-\r
+ switch (id) {\r
+ case 0: snprintf(retStr,sizeof(buf),"%d - RF/8",id); break;\r
+ case 1: snprintf(retStr,sizeof(buf),"%d - RF/16",id); break;\r
+ case 2: snprintf(retStr,sizeof(buf),"%d - RF/32",id); break;\r
+ case 3: snprintf(retStr,sizeof(buf),"%d - RF/40",id); break;\r
+ case 4: snprintf(retStr,sizeof(buf),"%d - RF/50",id); break;\r
+ case 5: snprintf(retStr,sizeof(buf),"%d - RF/64",id); break;\r
+ case 6: snprintf(retStr,sizeof(buf),"%d - RF/100",id); break;\r
+ case 7: snprintf(retStr,sizeof(buf),"%d - RF/128",id); break;\r
+ default: snprintf(retStr,sizeof(buf),"%d - (Unknown)",id); break;\r
+ }\r
return buf;\r
}\r
\r
-char * GetSaferStr(uint32_t id){\r
+char * GetSaferStr(uint32_t id) {\r
static char buf[40];\r
char *retStr = buf;\r
\r