aboutsummaryrefslogtreecommitdiffstats
path: root/src/figs.hpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-10-09 11:09:12 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-10-09 11:36:34 +0200
commit4bc1c0cf3e8c5dcc72a4bf971f0b78bbbe35cc57 (patch)
tree7f5e208a409c903278e7b86e3d2993a95a59ad58 /src/figs.hpp
parent40952170ec7a79274dc8185400d92c30de97538a (diff)
downloadetisnoop-4bc1c0cf3e8c5dcc72a4bf971f0b78bbbe35cc57.tar.gz
etisnoop-4bc1c0cf3e8c5dcc72a4bf971f0b78bbbe35cc57.tar.bz2
etisnoop-4bc1c0cf3e8c5dcc72a4bf971f0b78bbbe35cc57.zip
Add some FIG2 parsing
Diffstat (limited to 'src/figs.hpp')
-rw-r--r--src/figs.hpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/figs.hpp b/src/figs.hpp
index 64cfa48..bd144d7 100644
--- a/src/figs.hpp
+++ b/src/figs.hpp
@@ -1,6 +1,6 @@
/*
Copyright (C) 2014 CSP Innovazione nelle ICT s.c.a r.l. (http://www.csp.it/)
- Copyright (C) 2017 Matthias P. Braendli (http://www.opendigitalradio.org)
+ Copyright (C) 2018 Matthias P. Braendli (http://www.opendigitalradio.org)
Copyright (C) 2015 Data Path
This program is free software: you can redistribute it and/or modify
@@ -102,6 +102,29 @@ struct fig1_common_t {
uint8_t ext() { return f[0] & 0x07; }
};
+struct fig2_common_t {
+ fig2_common_t(
+ ensemble_database::ensemble_t &ens,
+ uint8_t* fig_data,
+ uint16_t fig_len) :
+ fibcrccorrect(true),
+ ensemble(ens),
+ f(fig_data),
+ figlen(fig_len) { }
+
+ // The ensemble only gets updated when the fib crc is ok
+ bool fibcrccorrect;
+ ensemble_database::ensemble_t& ensemble;
+
+ uint8_t* f;
+ uint16_t figlen;
+
+ uint8_t toggle_flag() { return (f[0] & 0x80) >> 7; }
+ uint8_t segment_index() { return (f[0] & 0x70) >> 4; }
+ uint16_t rfu() { return (f[0] & 0x08) >> 3; }
+ uint16_t ext() { return f[0] & 0x07; }
+};
+
// FIG 0/11 and 0/22 struct
struct Lat_Lng {
double latitude, longitude;
@@ -146,3 +169,5 @@ fig_result_t fig0_31(fig0_common_t& fig0, const display_settings_t &disp);
fig_result_t fig1_select(fig1_common_t& fig1, const display_settings_t &disp);
+fig_result_t fig2_select(fig2_common_t& fig2, const display_settings_t &disp);
+