AP_GPS: make L1/L5 check work on M10 modules too

tested on SierraAerospace L1L5 module
This commit is contained in:
Andrew Tridgell 2024-01-21 08:41:31 +11:00
parent 55a922563b
commit 6aaf6883ef
2 changed files with 14 additions and 8 deletions

View File

@ -347,7 +347,7 @@ const AP_Param::GroupInfo AP_GPS::var_info[] = {
// @Param: _DRV_OPTIONS
// @DisplayName: driver options
// @Description: Additional backend specific options
// @Bitmask: 0:Use UART2 for moving baseline on ublox,1:Use base station for GPS yaw on SBF,2:Use baudrate 115200,3:Use dedicated CAN port b/w GPSes for moving baseline,4:Use ellipsoid height instead of AMSL, 5: Override GPS satellite health of L5 band from L1 health
// @Bitmask: 0:Use UART2 for moving baseline on ublox,1:Use base station for GPS yaw on SBF,2:Use baudrate 115200,3:Use dedicated CAN port b/w GPSes for moving baseline,4:Use ellipsoid height instead of AMSL, 5:Override GPS satellite health of L5 band from L1 health
// @User: Advanced
AP_GROUPINFO("_DRV_OPTIONS", 22, AP_GPS, _driver_options, 0),

View File

@ -1323,7 +1323,8 @@ AP_GPS_UBLOX::_parse_gps(void)
log_mon_hw2();
}
break;
case MSG_MON_VER:
case MSG_MON_VER: {
bool check_L1L5 = false;
_have_version = true;
strncpy(_version.hwVersion, _buffer.mon_ver.hwVersion, sizeof(_version.hwVersion));
strncpy(_version.swVersion, _buffer.mon_ver.swVersion, sizeof(_version.swVersion));
@ -1343,16 +1344,11 @@ AP_GPS_UBLOX::_parse_gps(void)
}
_hardware_generation = UBLOX_F9;
}
// check if L1L5 in extension
if (memmem(_buffer.mon_ver.extension, sizeof(_buffer.mon_ver.extension), "L1L5", 4) != nullptr) {
supports_l5 = true;
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "u-blox supports L5 Band");
_unconfigured_messages |= CONFIG_L5;
}
if (strncmp(_version.swVersion, "EXT CORE 4", 10) == 0) {
// a M9
_hardware_generation = UBLOX_M9;
}
check_L1L5 = true;
}
// check for M10
if (strncmp(_version.hwVersion, "000A0000", 8) == 0) {
@ -1360,8 +1356,18 @@ AP_GPS_UBLOX::_parse_gps(void)
_hardware_generation = UBLOX_M10;
_unconfigured_messages |= CONFIG_M10;
}
check_L1L5 = true;
}
if (check_L1L5) {
// check if L1L5 in extension
if (memmem(_buffer.mon_ver.extension, sizeof(_buffer.mon_ver.extension), "L1L5", 4) != nullptr) {
supports_l5 = true;
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "u-blox supports L5 Band");
_unconfigured_messages |= CONFIG_L5;
}
}
break;
}
default:
unexpected_message();
}