|
|
|
@ -46,30 +46,28 @@ extern const AP_HAL::HAL& hal;
@@ -46,30 +46,28 @@ extern const AP_HAL::HAL& hal;
|
|
|
|
|
// for NMEA. GPS_AUTO will try to set any SiRF unit to binary mode as part of
|
|
|
|
|
// the autodetection process.
|
|
|
|
|
//
|
|
|
|
|
const prog_char AP_GPS_NMEA::_SiRF_init_string[] PROGMEM = |
|
|
|
|
"$PSRF103,0,0,1,1*25\r\n" // GGA @ 1Hz
|
|
|
|
|
"$PSRF103,1,0,0,1*25\r\n" // GLL off
|
|
|
|
|
"$PSRF103,2,0,0,1*26\r\n" // GSA off
|
|
|
|
|
"$PSRF103,3,0,0,1*27\r\n" // GSV off
|
|
|
|
|
"$PSRF103,4,0,1,1*20\r\n" // RMC off
|
|
|
|
|
"$PSRF103,5,0,1,1*20\r\n" // VTG @ 1Hz
|
|
|
|
|
"$PSRF103,6,0,0,1*22\r\n" // MSS off
|
|
|
|
|
"$PSRF103,8,0,0,1*2C\r\n" // ZDA off
|
|
|
|
|
"$PSRF151,1*3F\r\n" // WAAS on (not always supported)
|
|
|
|
|
"$PSRF106,21*0F\r\n" // datum = WGS84
|
|
|
|
|
""; |
|
|
|
|
#define SIRF_INIT_MSG \ |
|
|
|
|
"$PSRF103,0,0,1,1*25\r\n" /* GGA @ 1Hz */ \
|
|
|
|
|
"$PSRF103,1,0,0,1*25\r\n" /* GLL off */ \
|
|
|
|
|
"$PSRF103,2,0,0,1*26\r\n" /* GSA off */ \
|
|
|
|
|
"$PSRF103,3,0,0,1*27\r\n" /* GSV off */ \
|
|
|
|
|
"$PSRF103,4,0,1,1*20\r\n" /* RMC off */ \
|
|
|
|
|
"$PSRF103,5,0,1,1*20\r\n" /* VTG @ 1Hz */ \
|
|
|
|
|
"$PSRF103,6,0,0,1*22\r\n" /* MSS off */ \
|
|
|
|
|
"$PSRF103,8,0,0,1*2C\r\n" /* ZDA off */ \
|
|
|
|
|
"$PSRF151,1*3F\r\n" /* WAAS on (not always supported) */ \
|
|
|
|
|
"$PSRF106,21*0F\r\n" /* datum = WGS84 */ |
|
|
|
|
|
|
|
|
|
// MediaTek init messages //////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Note that we may see a MediaTek in NMEA mode if we are connected to a non-DIYDrones
|
|
|
|
|
// MediaTek-based GPS.
|
|
|
|
|
//
|
|
|
|
|
const prog_char AP_GPS_NMEA::_MTK_init_string[] PROGMEM = |
|
|
|
|
"$PMTK314,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" // GGA & VTG once every fix
|
|
|
|
|
"$PMTK330,0*2E\r\n" // datum = WGS84
|
|
|
|
|
"$PMTK313,1*2E\r\n" // SBAS on
|
|
|
|
|
"$PMTK301,2*2E\r\n" // use SBAS data for DGPS
|
|
|
|
|
""; |
|
|
|
|
#define MTK_INIT_MSG \ |
|
|
|
|
"$PMTK314,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" /* GGA & VTG once every fix */ \
|
|
|
|
|
"$PMTK330,0*2E\r\n" /* datum = WGS84 */ \
|
|
|
|
|
"$PMTK313,1*2E\r\n" /* SBAS on */ \
|
|
|
|
|
"$PMTK301,2*2E\r\n" /* use SBAS data for DGPS */ |
|
|
|
|
|
|
|
|
|
// ublox init messages /////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
@ -80,11 +78,12 @@ const prog_char AP_GPS_NMEA::_MTK_init_string[] PROGMEM =
@@ -80,11 +78,12 @@ const prog_char AP_GPS_NMEA::_MTK_init_string[] PROGMEM =
|
|
|
|
|
// We don't attempt to send $PUBX,41 as the unit must already be talking NMEA
|
|
|
|
|
// and we don't know the baudrate.
|
|
|
|
|
//
|
|
|
|
|
const prog_char AP_GPS_NMEA::_ublox_init_string[] PROGMEM = |
|
|
|
|
"$PUBX,40,gga,0,1,0,0,0,0*7B\r\n" // GGA on at one per fix
|
|
|
|
|
"$PUBX,40,vtg,0,1,0,0,0,0*7F\r\n" // VTG on at one per fix
|
|
|
|
|
"$PUBX,40,rmc,0,0,0,0,0,0*67\r\n" // RMC off (XXX suppress other message types?)
|
|
|
|
|
""; |
|
|
|
|
#define UBLOX_INIT_MSG \ |
|
|
|
|
"$PUBX,40,gga,0,1,0,0,0,0*7B\r\n" /* GGA on at one per fix */ \
|
|
|
|
|
"$PUBX,40,vtg,0,1,0,0,0,0*7F\r\n" /* VTG on at one per fix */ \
|
|
|
|
|
"$PUBX,40,rmc,0,0,0,0,0,0*67\r\n" /* RMC off (XXX suppress other message types?) */ |
|
|
|
|
|
|
|
|
|
const prog_char AP_GPS_NMEA::_initialisation_blob[] PROGMEM = SIRF_INIT_MSG MTK_INIT_MSG UBLOX_INIT_MSG; |
|
|
|
|
|
|
|
|
|
// NMEA message identifiers ////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
@ -105,14 +104,7 @@ AP_GPS_NMEA::AP_GPS_NMEA(AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDr
@@ -105,14 +104,7 @@ AP_GPS_NMEA::AP_GPS_NMEA(AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDr
|
|
|
|
|
_term_offset(0), |
|
|
|
|
_gps_data_good(false) |
|
|
|
|
{ |
|
|
|
|
// send the SiRF init strings
|
|
|
|
|
port->print_P((const prog_char_t *)_SiRF_init_string); |
|
|
|
|
|
|
|
|
|
// send the MediaTek init strings
|
|
|
|
|
port->print_P((const prog_char_t *)_MTK_init_string); |
|
|
|
|
|
|
|
|
|
// send the ublox init strings
|
|
|
|
|
port->print_P((const prog_char_t *)_ublox_init_string); |
|
|
|
|
gps.send_blob_start(state.instance, _initialisation_blob, sizeof(_initialisation_blob)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool AP_GPS_NMEA::read(void) |
|
|
|
|