aboutsummaryrefslogtreecommitdiff
path: root/tools/ootx_decode/ootx_decoder.h
diff options
context:
space:
mode:
authorJoshua Allen <axlecrusher@gmail.com>2017-02-10 18:12:32 -0500
committerJoshua Allen <axlecrusher@gmail.com>2017-02-10 18:12:32 -0500
commita4b9d6de0673f16c82b295ffc4778f6361e81fe8 (patch)
treeeb14534593e5db1bc5a5fc3b6c07d068bb90f653 /tools/ootx_decode/ootx_decoder.h
parent9ac3cddf749366f81540aac549ac7583602b7170 (diff)
downloadlibsurvive-a4b9d6de0673f16c82b295ffc4778f6361e81fe8.tar.gz
libsurvive-a4b9d6de0673f16c82b295ffc4778f6361e81fe8.tar.bz2
use decoding contexts to separate simultaneous lighthouse ootx decoding.
Diffstat (limited to 'tools/ootx_decode/ootx_decoder.h')
-rw-r--r--tools/ootx_decode/ootx_decoder.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/ootx_decode/ootx_decoder.h b/tools/ootx_decode/ootx_decoder.h
index 3a14f74..2c0ee63 100644
--- a/tools/ootx_decode/ootx_decoder.h
+++ b/tools/ootx_decode/ootx_decoder.h
@@ -14,8 +14,21 @@ typedef struct {
uint32_t crc32;
} ootx_packet;
-void ootx_init_buffer();
-void ootx_process_bit(uint32_t length);
+typedef struct {
+ uint8_t* buffer;
+ uint16_t buf_offset;
+ uint8_t bits_written;
+ uint16_t* payload_size;
+
+ uint32_t preamble;
+ uint8_t bits_processed;
+ uint8_t found_preamble;
+} ootx_decoder_context;
+
+
+//void ootx_init_buffer();
+void ootx_process_bit(ootx_decoder_context *ctx, uint32_t length);
+void ootx_init_decoder_context(ootx_decoder_context *ctx);
extern void (*ootx_packet_clbk)(ootx_packet* packet);