From e0be9c733599fcbde5263da2299dd12054826160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oona=20R=C3=A4is=C3=A4nen?= Date: Sun, 15 May 2022 09:46:23 +0300 Subject: [PATCH] Decode LTCC, LTECC (#80) These values are merely printed in the JSON and not used further also, silence warnings about unused parameters --- src/groups.cc | 2 ++ src/tmc/tmc.cc | 15 +++++---------- src/tmc/tmc.h | 1 - 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/groups.cc b/src/groups.cc index 3b68823..123dcbc 100644 --- a/src/groups.cc +++ b/src/groups.cc @@ -681,11 +681,13 @@ void Station::decodeType6(const Group& group) { // Group 7A: Radio Paging void Station::decodeType7A(const Group& group) { + (void)group; json_["debug"].append("TODO: 7A"); } // Group 9A: Emergency warning systems void Station::decodeType9A(const Group& group) { + (void)group; json_["debug"].append("TODO: 9A"); } diff --git a/src/tmc/tmc.cc b/src/tmc/tmc.cc index ebb6c06..798caa2 100644 --- a/src/tmc/tmc.cc +++ b/src/tmc/tmc.cc @@ -494,7 +494,6 @@ void TMCService::receiveSystemGroup(uint16_t message, Json::Value* jsonroot) { bool afi = getBits<1>(message, 5); uint16_t mgs = getBits<4>(message, 0); - is_enhanced_mode_ = getBits<1>(message, 4); (*jsonroot)["tmc"]["system_info"]["is_on_alt_freqs"] = afi; @@ -508,15 +507,11 @@ void TMCService::receiveSystemGroup(uint16_t message, Json::Value* jsonroot) { static const int gap_values[4] = {3, 5, 8, 11}; (*jsonroot)["tmc"]["system_info"]["gap"] = gap_values[g]; - if (is_enhanced_mode_) { - uint16_t t_d = getBits<2>(message, 0); - uint16_t t_w = getBits<2>(message, 2); - uint16_t t_a = getBits<2>(message, 4); - - (*jsonroot)["tmc"]["system_info"]["delay_time"] = t_d; - (*jsonroot)["tmc"]["system_info"]["activity_time"] = 1 << t_a; - (*jsonroot)["tmc"]["system_info"]["window_time"] = 1 << t_w; - } + int ltcc = getBits<4>(message, 0); + (*jsonroot)["tmc"]["system_info"]["ltcc"] = ltcc; + } else if (variant == 2) { + int ltecc = getBits<8>(message, 0); + (*jsonroot)["tmc"]["system_info"]["ltecc"] = ltecc; } } diff --git a/src/tmc/tmc.h b/src/tmc/tmc.h index cf8eaec..59185e9 100644 --- a/src/tmc/tmc.h +++ b/src/tmc/tmc.h @@ -200,7 +200,6 @@ class TMCService { bool is_initialized_ { false }; bool is_encrypted_ { false }; bool has_encid_ { false }; - bool is_enhanced_mode_ { false }; uint16_t ltn_ { 0 }; uint16_t sid_ { 0 }; uint16_t encid_ { 0 };