aboutsummaryrefslogtreecommitdiffstats
path: root/src/hdlc.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-10-26 09:38:24 +0200
committerHarald Welte <laforge@gnumonks.org>2016-10-26 09:38:24 +0200
commitd83c51379b52d3bd94db57de046ba674377b4386 (patch)
tree2a494c8469fbfbeceb6f1479d92e5c9098c39439 /src/hdlc.h
parent59b94d061172bf683eb4edc4e67a64f9760e33ba (diff)
WIP: More work on SuperChannel decode, but it doesn't work yet...
Diffstat (limited to 'src/hdlc.h')
-rw-r--r--src/hdlc.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/hdlc.h b/src/hdlc.h
new file mode 100644
index 0000000..10ec8e2
--- /dev/null
+++ b/src/hdlc.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <osmocom/core/bits.h>
+
+enum hdlc_proc_state {
+ STATE_INIT,
+ STATE_FLAG_WAIT_ZERO,
+ STATE_PAYLOAD,
+};
+
+struct hdlc_proc {
+ ubit_t history[8];
+ ubit_t next_outbyte[8];
+ enum hdlc_proc_state state;
+ uint8_t num_bits;
+};
+
+int process_raw_hdlc(struct hdlc_proc *hdlc, uint8_t *data, unsigned int len);