Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_GPS: ublox: log the first seen uptime from the reciever #12110

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions libraries/AP_GPS/AP_GPS_UBLOX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ AP_GPS_UBLOX::_verify_rate(uint8_t msg_class, uint8_t msg_id, uint8_t rate) {
}
break;
case MSG_STATUS:
desired_rate = havePvtMsg ? 0 : RATE_STATUS;
desired_rate = (havePvtMsg && (first_msss != 0)) ? 0 : RATE_STATUS;
if(rate == desired_rate) {
_unconfigured_messages &= ~CONFIG_RATE_STATUS;
} else {
Expand Down Expand Up @@ -935,7 +935,12 @@ AP_GPS_UBLOX::_parse_gps(void)
_buffer.status.fix_status,
_buffer.status.fix_type);
_check_new_itow(_buffer.status.itow);
if (havePvtMsg) {
if (first_msss == 0 && _buffer.status.uptime != 0) {
first_msss = _buffer.status.uptime;
gcs().send_text(MAV_SEVERITY_DEBUG, "u-blox %d uptime on detection: %u",
state.instance+1, first_msss);
}
if (havePvtMsg && (first_msss != 0)) {
_unconfigured_messages |= CONFIG_RATE_STATUS;
break;
}
Expand Down Expand Up @@ -1428,6 +1433,11 @@ void AP_GPS_UBLOX::Write_AP_Logger_Log_Startup_messages() const
_version.hwVersion,
_version.swVersion);
}
if (first_msss != 0) {
AP::logger().Write_MessageF("u-blox %d uptime on detection: %u",
state.instance+1,
first_msss);
}
}

// uBlox specific check_new_itow(), handling message length
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_GPS/AP_GPS_UBLOX.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ class AP_GPS_UBLOX : public AP_GPS_Backend
// do we have new speed information?
bool _new_speed:1;

uint32_t first_msss; // first milliseconds since startup seen

uint8_t _disable_counter;

// Buffer parse & GPS state update
Expand Down