AP_GPS: Added ERB to AP_GPS

This commit is contained in:
Alexey Bulatov 2016-01-19 00:54:40 +03:00 committed by Tom Pittenger
parent 7e2c822499
commit 3933ac2a63
2 changed files with 8 additions and 0 deletions

View File

@ -295,6 +295,11 @@ AP_GPS::detect_instance(uint8_t instance)
_broadcast_gps_type("SIRF", instance, dstate->last_baud); _broadcast_gps_type("SIRF", instance, dstate->last_baud);
new_gps = new AP_GPS_SIRF(*this, state[instance], _port[instance]); 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)) { else if (now - dstate->detect_started_ms > (ARRAY_SIZE(_baudrates) * GPS_BAUD_TIME_MS)) {
// prevent false detection of NMEA mode in // prevent false detection of NMEA mode in
// a MTK or UBLOX which has booted in NMEA mode // a MTK or UBLOX which has booted in NMEA mode

View File

@ -70,6 +70,7 @@ public:
GPS_TYPE_SBF = 10, GPS_TYPE_SBF = 10,
GPS_TYPE_GSOF = 11, GPS_TYPE_GSOF = 11,
GPS_TYPE_QURT = 12, GPS_TYPE_QURT = 12,
GPS_TYPE_ERB = 13,
}; };
/// GPS status codes /// GPS status codes
@ -379,6 +380,7 @@ private:
struct SIRF_detect_state sirf_detect_state; struct SIRF_detect_state sirf_detect_state;
struct NMEA_detect_state nmea_detect_state; struct NMEA_detect_state nmea_detect_state;
struct SBP_detect_state sbp_detect_state; struct SBP_detect_state sbp_detect_state;
struct ERB_detect_state erb_detect_state;
} detect_state[GPS_MAX_INSTANCES]; } detect_state[GPS_MAX_INSTANCES];
struct { struct {
@ -408,5 +410,6 @@ private:
#include "AP_GPS_QURT.h" #include "AP_GPS_QURT.h"
#include "AP_GPS_SBF.h" #include "AP_GPS_SBF.h"
#include "AP_GPS_GSOF.h" #include "AP_GPS_GSOF.h"
#include "AP_GPS_ERB.h"
#endif // __AP_GPS_H__ #endif // __AP_GPS_H__