summaryrefslogtreecommitdiff
path: root/gsm-receiver/src/lib/decoder/cch.h
diff options
context:
space:
mode:
authorPiotr Krysik <perper@o2.pl>2009-06-30 23:10:11 +0200
committerPiotr Krysik <perper@o2.pl>2009-06-30 23:10:11 +0200
commit3f91ce4f1c4a047a94497041b82c77c815d52a1f (patch)
treeed787719fb4e89670cc2161ecd4136c554834686 /gsm-receiver/src/lib/decoder/cch.h
parent26a95cc318fcc8022a42f679d81b41d949771b8d (diff)
parent8d2bc49fb9e0c9a5fbd75aa3cad207608e72bf99 (diff)
Merge branch 'moving_to_airprobe'
Diffstat (limited to 'gsm-receiver/src/lib/decoder/cch.h')
-rw-r--r--gsm-receiver/src/lib/decoder/cch.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/gsm-receiver/src/lib/decoder/cch.h b/gsm-receiver/src/lib/decoder/cch.h
new file mode 100644
index 0000000..a642721
--- /dev/null
+++ b/gsm-receiver/src/lib/decoder/cch.h
@@ -0,0 +1,56 @@
+//TODO: this file shouldn't be part of the GSM Receiver
+#ifndef __GSMSTACK_CCH_H__
+#define __GSMSTACK_CCH_H__ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "gsmstack.h"
+
+/*
+ * decode_cch
+ *
+ * Decode a "common" control channel. Most control channels use
+ * the same burst, interleave, Viterbi and parity configuration.
+ * The documentation for the control channels defines SACCH first
+ * and then just keeps referring to that.
+ *
+ * The current (investigated) list is as follows:
+ *
+ * BCCH Norm
+ * BCCH Ext
+ * PCH
+ * AGCH
+ * CBCH (SDCCH/4)
+ * CBCH (SDCCH/8)
+ * SDCCH/4
+ * SACCH/C4
+ * SDCCH/8
+ * SACCH/C8
+ *
+ * We provide two functions, one for where all four bursts are
+ * contiguous, and one where they aren't.
+ */
+
+#define DATA_BLOCK_SIZE 184
+#define PARITY_SIZE 40
+#define FLUSH_BITS_SIZE 4
+#define PARITY_OUTPUT_SIZE (DATA_BLOCK_SIZE + PARITY_SIZE + FLUSH_BITS_SIZE)
+
+#define CONV_INPUT_SIZE PARITY_OUTPUT_SIZE
+#define CONV_SIZE (2 * CONV_INPUT_SIZE)
+
+#define BLOCKS 4
+#define iBLOCK_SIZE (CONV_SIZE / BLOCKS)
+#define eBLOCK_SIZE (iBLOCK_SIZE + 2)
+
+unsigned char *decode_cch(GS_CTX *ctx, unsigned char *burst, unsigned int *len);
+//unsigned char *decode_cch(GS_CTX *ctx, unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned int *len);
+//unsigned char *decode_cch(GS_CTX *ctx, unsigned char *, unsigned int *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
personal git repositories of Harald Welte. Your mileage may vary