summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2013-01-12 17:03:39 +0200
committerYuval Adam <yuv.adm@gmail.com>2013-01-12 17:03:39 +0200
commit9b7da31e44dcfa01ee65ce13de993c7c46828b45 (patch)
tree1f53520e6ba59a75a7b1a274257552521c320966
parentf5a0b2d6d04199c58dfdfdc63c6d3151c54b56b4 (diff)
Some more consts and cleanup
-rw-r--r--dumpocsag.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/dumpocsag.c b/dumpocsag.c
index 47a292b..f3527b2 100644
--- a/dumpocsag.c
+++ b/dumpocsag.c
@@ -13,14 +13,28 @@
#include "rtl-sdr.h"
/* POCSAG parameters */
-#define POCSAG_ID "POCSAG"
-#define POCSAG_SYM_RATE 1200
-#define POCSAG_FM_DEV 4500
-#define POCSAG_SPS 8
+#define POCSAG_ID "POCSAG"
+#define POCSAG_SYM_RATE 1200
+#define POCSAG_FM_DEV 4500
+#define POCSAG_SPS 8
+#define POCSAG_STD_SYNC 0x7cd215d8
+#define POCSAG_STD_IDLE 0x7a89c197
+#define POCSAG_WORDSIZE 32
+#define POCSAG_SOFTTHRESHOLD 2
+#define POCSAG_MAXWORD 16
+
+/* BCH parameters */
+#define POCSAG_BCH_POLY 0x769
+#define POCSAG_BCH_N 31
+#define POCSAG_BCH_K 21
+
+/* POCASG states */
+#define POCSAG_SEARCH_PREAMBLE_START 0
+#define POCSAG_SEARCH_PREAMBLE_END 1
+#define POCSAG_SYNC 2
+#define POCSAG_SEARCH_SYNC 3
+#define POCSAG_SYNCHED 4
-#define POCSAG_BCH_POLY 0x769
-#define POCSAG_BCH_N 31
-#define POCSAG_BCH_K 21
int hammingWeight(int n) {
unsigned int c;