Skip to content

Commit

Permalink
Decode LTCC, LTECC (#80)
Browse files Browse the repository at this point in the history
These values are merely printed in the JSON and not used further

also, silence warnings about unused parameters
  • Loading branch information
windytan committed May 15, 2022
1 parent 0679116 commit e0be9c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/groups.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
15 changes: 5 additions & 10 deletions src/tmc/tmc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
}

Expand Down
1 change: 0 additions & 1 deletion src/tmc/tmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down

0 comments on commit e0be9c7

Please sign in to comment.