diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index 25a790787a..52f622458e 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -999,6 +999,14 @@ void AP_GPS::update_instance(uint8_t instance) tnow = state[instance].last_corrected_gps_time_us/1000U; state[instance].corrected_timestamp_updated = false; } + + // we set delta_time_ms to the timeout value when clearing + // state; use it being zero to mark first message + if (!state[instance].announced_detection) { + state[instance].announced_detection = true; + GCS_SEND_TEXT(MAV_SEVERITY_INFO, "GPS %d: detected %s", instance + 1, drivers[instance]->name()); + } + // delta will only be correct after parsing two messages timing[instance].delta_time_ms = tnow - timing[instance].last_message_time_ms; timing[instance].last_message_time_ms = tnow; diff --git a/libraries/AP_GPS/AP_GPS.h b/libraries/AP_GPS/AP_GPS.h index a5ca9cdcea..b48bf453a4 100644 --- a/libraries/AP_GPS/AP_GPS.h +++ b/libraries/AP_GPS/AP_GPS.h @@ -212,6 +212,7 @@ public: float undulation; //snprintf(buffer, buflen, - "GPS %d: detected as %s at %d baud", + "GPS %d: probing for %s at %d baud", instance + 1, name(), int(gps._baudrates[dstate.current_baud]));