#pragma once #include #include #include #include "navmon.hh" #include #include "minivec.hh" // 0 do not use // 1 PRN mask // 2-5 fast corrections // 7 Fast correction degradation factor // 10 Degradation parameters // 18 Ionospheric grid point masks // 24 Mixed fastllong-term satellite error corrections // 25 half-message // 26 Ionospheric delay corrections // 27 SBAS service message // GSA HQ Prague const Point c_egnosCenter{3970085, 1021937, 4869792}; // Somewhere in Minnesota, Dakota, Canada border const Point c_waasCenter{-510062, -4166466, 4786089}; struct SBASState { struct FastCorrection { SatID id; double correction; int udrei; time_t lastUpdate{-1}; }; struct LongTermCorrection { SatID id; int iod8; int toa; int iodp; double dx, dy, dz, dai; double ddx{0}, ddy{0}, ddz{0}, ddai{0}; bool velocity{false}; time_t lastUpdate{-1}; }; std::pair, std::vector> parse(const std::basic_string& sbas, time_t now); void parse0(const std::basic_string& message, time_t now); // updates slot2prn mapping void parse1(const std::basic_string& message, time_t now); std::vector parse2_5(const std::basic_string& message, time_t now); std::vector parse6(const std::basic_string& message, time_t now); void parse7(const std::basic_string& message, time_t now); std::pair, std::vector> parse24(const std::basic_string& message, time_t now); std::vector parse25(const std::basic_string& message, time_t now); int getSBASNumber(int slot) const; SatID getSBASSatID(int slot) const; std::map d_fast; std::map d_longterm; time_t d_lastDNU{-1}; std::map d_slot2prn; int d_latency = -1; time_t d_lastSeen{-1}; void parse25H(const std::basic_string& sbas, time_t t, int offset, std::vector& ret); }; struct SBASCombo { SBASState::FastCorrection fast; SBASState::LongTermCorrection longterm; };