mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-06 05:34:50 -04:00
slightly improved ads-b receiver module (#2649)
* slightly improved ads-b receiver module: * fix Heading, Speed and Vrate decoders * decode more ModeS messages * log all ModeS messages (except DF11) * fix formatting (clang-style); advice on data alignment taken into account * ADS-B module: convert Indicated AirSpeed to True AirSpeed if altitute is known * ADS-B rx module: replacing floating point with integer arithmetic
This commit is contained in:
parent
61bd696b69
commit
84cb32ee14
7 changed files with 221 additions and 86 deletions
|
@ -95,8 +95,8 @@ struct AircraftRecentEntry {
|
|||
ADSBAgeState state{ADSBAgeState::Invalid};
|
||||
uint32_t age{0}; // In seconds
|
||||
uint32_t amp{0};
|
||||
adsb_pos pos{false, 0, 0, 0};
|
||||
adsb_vel velo{false, 0, 999, 0};
|
||||
adsb_pos pos{false, false, 0, 0, 0};
|
||||
adsb_vel velo{false, SPD_GND, 0, 999, 0};
|
||||
ADSBFrame frame_pos_even{};
|
||||
ADSBFrame frame_pos_odd{};
|
||||
|
||||
|
@ -105,6 +105,7 @@ struct AircraftRecentEntry {
|
|||
std::string info_string{};
|
||||
|
||||
uint8_t sil{0}; // Surveillance integrity level
|
||||
uint16_t sqwk{0};
|
||||
|
||||
AircraftRecentEntry(const uint32_t ICAO_address)
|
||||
: ICAO_address{ICAO_address} {
|
||||
|
@ -152,8 +153,8 @@ struct AircraftRecentEntry {
|
|||
age += delta;
|
||||
|
||||
if (age < ADSBAgeLimit::Current)
|
||||
state = pos.valid ? ADSBAgeState::Invalid
|
||||
: ADSBAgeState::Current;
|
||||
state = pos.pos_valid ? ADSBAgeState::Current
|
||||
: ADSBAgeState::Invalid;
|
||||
|
||||
else if (age < ADSBAgeLimit::Recent)
|
||||
state = ADSBAgeState::Recent;
|
||||
|
@ -178,6 +179,7 @@ struct ADSBLogEntry {
|
|||
adsb_vel vel{};
|
||||
uint8_t vel_type{};
|
||||
uint8_t sil{};
|
||||
uint16_t sqwk{};
|
||||
};
|
||||
|
||||
// TODO: Make logging optional.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue