Skip to content

Commit

Permalink
AP_GPS: SBF report correct satellite count on NrSV DNU value
Browse files Browse the repository at this point in the history
When the NrSV field of the SBF PVTGeodetic message contains the
Do-Not-Use value of 255, set the satellite count to 0 instead of
ignoring the change.
  • Loading branch information
flyingthingsintothings committed Apr 10, 2024
1 parent ac271cf commit b593a12
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libraries/AP_GPS/AP_GPS_SBF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,10 @@ AP_GPS_SBF::process_message(void)
set_alt_amsl_cm(state, ((float)temp.Height - temp.Undulation) * 1e2f);
}

if (temp.NrSV != 255) {
state.num_sats = temp.NrSV;
state.num_sats = temp.NrSV;
if (temp.NrSV == 255) {
// Do-Not-Use value for NrSV field in PVTGeodetic message
state.num_sats = 0;
}

Debug("temp.Mode=0x%02x\n", (unsigned)temp.Mode);
Expand Down

0 comments on commit b593a12

Please sign in to comment.