AP_GPS: Novatel respect the auto config disable parameter

This commit is contained in:
Michael du Breuil 2021-06-11 13:42:13 -07:00 committed by Andrew Tridgell
parent eedcb9aded
commit f08866639e
1 changed files with 19 additions and 14 deletions

View File

@ -48,12 +48,14 @@ AP_GPS_NOVA::AP_GPS_NOVA(AP_GPS &_gps, AP_GPS::GPS_State &_state,
nova_msg.header.data[1] = NOVA_PREAMBLE2;
nova_msg.header.data[2] = NOVA_PREAMBLE3;
if (gps._auto_config != AP_GPS::GPS_AUTO_CONFIG_DISABLE) {
const char *init_str = _initialisation_blob[0];
const char *init_str1 = _initialisation_blob[1];
port->write((const uint8_t*)init_str, strlen(init_str));
port->write((const uint8_t*)init_str1, strlen(init_str1));
}
}
const char* const AP_GPS_NOVA::_initialisation_blob[6] {
"\r\n\r\nunlogall\r\n", // cleanup enviroment
@ -69,7 +71,8 @@ const char* const AP_GPS_NOVA::_initialisation_blob[6] {
bool
AP_GPS_NOVA::read(void)
{
uint32_t now = AP_HAL::millis();
if (gps._auto_config != AP_GPS::GPS_AUTO_CONFIG_DISABLE) {
const uint32_t now = AP_HAL::millis();
if (_init_blob_index < (sizeof(_initialisation_blob) / sizeof(_initialisation_blob[0]))) {
const char *init_str = _initialisation_blob[_init_blob_index];
@ -80,6 +83,7 @@ AP_GPS_NOVA::read(void)
_init_blob_index++;
}
}
}
bool ret = false;
while (port->available() > 0) {
@ -97,8 +101,9 @@ AP_GPS_NOVA::parse(uint8_t temp)
{
default:
case nova_msg_parser::PREAMBLE1:
if (temp == NOVA_PREAMBLE1)
if (temp == NOVA_PREAMBLE1) {
nova_msg.nova_state = nova_msg_parser::PREAMBLE2;
}
nova_msg.read = 0;
break;
case nova_msg_parser::PREAMBLE2:
@ -181,7 +186,7 @@ AP_GPS_NOVA::parse(uint8_t temp)
bool
AP_GPS_NOVA::process_message(void)
{
uint16_t messageid = nova_msg.header.nova_headeru.messageid;
const uint16_t messageid = nova_msg.header.nova_headeru.messageid;
Debug("NOVA process_message messid=%u\n",messageid);