diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index 000630e5df..b77549543c 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -295,6 +295,11 @@ AP_GPS::detect_instance(uint8_t instance) _broadcast_gps_type("SIRF", instance, dstate->last_baud); new_gps = new AP_GPS_SIRF(*this, state[instance], _port[instance]); } + else if ((_type[instance] == GPS_TYPE_AUTO || _type[instance] == GPS_TYPE_ERB) && + AP_GPS_ERB::_detect(dstate->erb_detect_state, data)) { + _broadcast_gps_type("ERB", instance, dstate->last_baud); + new_gps = new AP_GPS_ERB(*this, state[instance], _port[instance]); + } else if (now - dstate->detect_started_ms > (ARRAY_SIZE(_baudrates) * GPS_BAUD_TIME_MS)) { // prevent false detection of NMEA mode in // a MTK or UBLOX which has booted in NMEA mode diff --git a/libraries/AP_GPS/AP_GPS.h b/libraries/AP_GPS/AP_GPS.h index b427c2a335..ab8a589503 100644 --- a/libraries/AP_GPS/AP_GPS.h +++ b/libraries/AP_GPS/AP_GPS.h @@ -70,6 +70,7 @@ public: GPS_TYPE_SBF = 10, GPS_TYPE_GSOF = 11, GPS_TYPE_QURT = 12, + GPS_TYPE_ERB = 13, }; /// GPS status codes @@ -379,6 +380,7 @@ private: struct SIRF_detect_state sirf_detect_state; struct NMEA_detect_state nmea_detect_state; struct SBP_detect_state sbp_detect_state; + struct ERB_detect_state erb_detect_state; } detect_state[GPS_MAX_INSTANCES]; struct { @@ -408,5 +410,6 @@ private: #include "AP_GPS_QURT.h" #include "AP_GPS_SBF.h" #include "AP_GPS_GSOF.h" +#include "AP_GPS_ERB.h" #endif // __AP_GPS_H__