From 911732677373c7f6a1a75a57038b1e6c28257aeb Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Mon, 25 Dec 2023 00:50:47 +0100 Subject: [PATCH] Add MSP2_UBLOX_REQUEST_SV_INFO (#3689) * Add MSP2_GPS_REQUEST_SV_INFO * Rename MSP * Add console message for request --- src/js/msp/MSPCodes.js | 1 + src/js/msp/MSPHelper.js | 4 ++++ src/js/tabs/gps.js | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/src/js/msp/MSPCodes.js b/src/js/msp/MSPCodes.js index bbbc25749e..62b3a98129 100644 --- a/src/js/msp/MSPCodes.js +++ b/src/js/msp/MSPCodes.js @@ -199,6 +199,7 @@ const MSPCodes = { MSP2_GET_LED_STRIP_CONFIG_VALUES: 0x3008, MSP2_SET_LED_STRIP_CONFIG_VALUES: 0x3009, MSP2_SENSOR_CONFIG_ACTIVE: 0x300A, + MSP2_UBLOX_REQUEST_SV_INFO: 0x300B, // MSP2_GET_TEXT and MSP2_SET_TEXT variable types PILOT_NAME: 1, diff --git a/src/js/msp/MSPHelper.js b/src/js/msp/MSPHelper.js index 0b74823a77..5efcc78384 100644 --- a/src/js/msp/MSPHelper.js +++ b/src/js/msp/MSPHelper.js @@ -1608,6 +1608,10 @@ MspHelper.prototype.process_data = function(dataHandler) { console.log('DSHOT command sent'); break; + case MSPCodes.MSP2_UBLOX_REQUEST_SV_INFO: + console.log('UBLOX SV info requested'); + break; + case MSPCodes.MSP_MULTIPLE_MSP: let hasReturnedSomeCommand = false; // To avoid infinite loops diff --git a/src/js/tabs/gps.js b/src/js/tabs/gps.js index 802d9356d6..a83c0c0c66 100644 --- a/src/js/tabs/gps.js +++ b/src/js/tabs/gps.js @@ -29,6 +29,11 @@ gps.initialize = async function (callback) { await MSP.promise(MSPCodes.MSP_GPS_CONFIG); + // GPS SV info request added in 1.46 for UBLOX protocol + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46) && FC.GPS_CONFIG.provider === 1) { + await MSP.promise(MSPCodes.MSP2_UBLOX_REQUEST_SV_INFO); + } + load_html(); function load_html() {