diff --git a/Tools/Replay/LR_MsgHandler.cpp b/Tools/Replay/LR_MsgHandler.cpp index d13d967966..d468c51d16 100644 --- a/Tools/Replay/LR_MsgHandler.cpp +++ b/Tools/Replay/LR_MsgHandler.cpp @@ -154,12 +154,17 @@ void LR_MsgHandler_GPS_Base::update_from_msg_gps(uint8_t gps_offset, uint8_t *ms ! field_value(msg, "HDp", hdop)) { hdop = 20; } + uint8_t nsats = 0; + if (! field_value(msg, "NSats", nsats) && + ! field_value(msg, "numSV", nsats)) { + field_not_found(msg, "NSats"); + } gps.setHIL(gps_offset, (AP_GPS::GPS_Status)status, uint32_t(time_us/1000), loc, vel, - require_field_uint8_t(msg, "NSats"), + nsats, hdop, require_field_float(msg, "VZ") != 0); if (status == AP_GPS::GPS_OK_FIX_3D && ground_alt_cm == 0) { diff --git a/Tools/Replay/MsgHandler.h b/Tools/Replay/MsgHandler.h index 451e8b3592..d29ce81e3f 100644 --- a/Tools/Replay/MsgHandler.h +++ b/Tools/Replay/MsgHandler.h @@ -67,7 +67,6 @@ private: void init_field_types(); void add_field_type(char type, size_t size); uint8_t size_for_type(char type); - void field_not_found(uint8_t *msg, const char *label); protected: struct log_Format f; // the format we are a parser for @@ -87,6 +86,7 @@ protected: const char *label_roll, const char *label_pitch, const char *label_yaw); + void field_not_found(uint8_t *msg, const char *label); }; template