CF/BF - Add support for updated MSP_GPS_CONFIG in API v1.34.0
parent
248f2ec727
commit
158b36cd9c
|
@ -712,6 +712,12 @@
|
||||||
"configurationGPSubxSbas": {
|
"configurationGPSubxSbas": {
|
||||||
"message": "Ground Assistance Type"
|
"message": "Ground Assistance Type"
|
||||||
},
|
},
|
||||||
|
"configurationGPSAutoBaud": {
|
||||||
|
"message": "Auto Baud"
|
||||||
|
},
|
||||||
|
"configurationGPSAutoConfig": {
|
||||||
|
"message": "Auto Config"
|
||||||
|
},
|
||||||
"configurationGPSHelp": {
|
"configurationGPSHelp": {
|
||||||
"message": "<strong>Note:</strong> Remember to configure a Serial Port (via Ports tab) when using GPS feature."
|
"message": "<strong>Note:</strong> Remember to configure a Serial Port (via Ports tab) when using GPS feature."
|
||||||
},
|
},
|
||||||
|
|
2
js/fc.js
2
js/fc.js
|
@ -232,6 +232,8 @@ var FC = {
|
||||||
GPS_CONFIG = {
|
GPS_CONFIG = {
|
||||||
provider: 0,
|
provider: 0,
|
||||||
ublox_sbas: 0,
|
ublox_sbas: 0,
|
||||||
|
auto_config: 0,
|
||||||
|
auto_baud: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
COMPASS_CONFIG = {
|
COMPASS_CONFIG = {
|
||||||
|
|
|
@ -329,6 +329,10 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
||||||
case MSPCodes.MSP_GPS_CONFIG:
|
case MSPCodes.MSP_GPS_CONFIG:
|
||||||
GPS_CONFIG.provider = data.readU8();
|
GPS_CONFIG.provider = data.readU8();
|
||||||
GPS_CONFIG.ublox_sbas = data.readU8();
|
GPS_CONFIG.ublox_sbas = data.readU8();
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.34.0")) {
|
||||||
|
GPS_CONFIG.auto_config = data.readU8();
|
||||||
|
GPS_CONFIG.auto_baud = data.readU8();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_RSSI_CONFIG:
|
case MSPCodes.MSP_RSSI_CONFIG:
|
||||||
RSSI_CONFIG.channel = data.readU8();
|
RSSI_CONFIG.channel = data.readU8();
|
||||||
|
@ -1213,6 +1217,10 @@ MspHelper.prototype.crunch = function(code) {
|
||||||
case MSPCodes.MSP_SET_GPS_CONFIG:
|
case MSPCodes.MSP_SET_GPS_CONFIG:
|
||||||
buffer.push8(GPS_CONFIG.provider)
|
buffer.push8(GPS_CONFIG.provider)
|
||||||
.push8(GPS_CONFIG.ublox_sbas);
|
.push8(GPS_CONFIG.ublox_sbas);
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.34.0")) {
|
||||||
|
buffer.push8(GPS_CONFIG.auto_config)
|
||||||
|
.push8(GPS_CONFIG.auto_baud);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_SET_COMPASS_CONFIG:
|
case MSPCodes.MSP_SET_COMPASS_CONFIG:
|
||||||
buffer.push16(Math.round(COMPASS_CONFIG.mag_declination * 100));
|
buffer.push16(Math.round(COMPASS_CONFIG.mag_declination * 100));
|
||||||
|
|
|
@ -442,6 +442,22 @@
|
||||||
</select>
|
</select>
|
||||||
<span i18n="configurationGPSBaudrate"></span>
|
<span i18n="configurationGPSBaudrate"></span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="select gps_auto_baud">
|
||||||
|
<div style="float: left; height: 20px; margin-right: 15px; margin-left: 3px;">
|
||||||
|
<input type="checkbox" name="gps_auto_baud" class="toggle" />
|
||||||
|
</div>
|
||||||
|
<label for="gps_auto_baud"> <span class="freelabel"
|
||||||
|
i18n="configurationGPSAutoBaud"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="select gps_auto_config">
|
||||||
|
<div style="float: left; height: 20px; margin-right: 15px; margin-left: 3px;">
|
||||||
|
<input type="checkbox" name="gps_auto_config" class="toggle" />
|
||||||
|
</div>
|
||||||
|
<label for="gps_auto_config"> <span class="freelabel"
|
||||||
|
i18n="configurationGPSAutoConfig"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<select class="gps_ubx_sbas">
|
<select class="gps_ubx_sbas">
|
||||||
<!-- list generated here -->
|
<!-- list generated here -->
|
||||||
|
|
|
@ -408,6 +408,15 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
gps_protocol_e.val(GPS_CONFIG.provider);
|
gps_protocol_e.val(GPS_CONFIG.provider);
|
||||||
|
|
||||||
|
$('input[name="gps_auto_baud"]').prop('checked', GPS_CONFIG.auto_baud == 1);
|
||||||
|
$('input[name="gps_auto_config"]').prop('checked', GPS_CONFIG.auto_config == 1);
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.34.0")) {
|
||||||
|
$('.select.gps_auto_baud').show();
|
||||||
|
$('.select.gps_auto_config').show();
|
||||||
|
} else {
|
||||||
|
$('.select.gps_auto_baud').hide();
|
||||||
|
$('.select.gps_auto_config').hide();
|
||||||
|
}
|
||||||
|
|
||||||
var gps_baudrate_e = $('select.gps_baudrate');
|
var gps_baudrate_e = $('select.gps_baudrate');
|
||||||
for (var i = 0; i < gpsBaudRates.length; i++) {
|
for (var i = 0; i < gpsBaudRates.length; i++) {
|
||||||
|
@ -690,6 +699,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function save_gps_config() {
|
function save_gps_config() {
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.34.0")) {
|
||||||
|
GPS_CONFIG.auto_baud = $('input[name="gps_auto_baud"]').is(':checked') ? 1 : 0;
|
||||||
|
GPS_CONFIG.auto_config = $('input[name="gps_auto_config"]').is(':checked') ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
var next_callback = save_compass_config;
|
var next_callback = save_compass_config;
|
||||||
if(semver.gte(CONFIG.apiVersion, "1.33.0")) {
|
if(semver.gte(CONFIG.apiVersion, "1.33.0")) {
|
||||||
MSP.send_message(MSPCodes.MSP_SET_GPS_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_GPS_CONFIG), false, next_callback);
|
MSP.send_message(MSPCodes.MSP_SET_GPS_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_GPS_CONFIG), false, next_callback);
|
||||||
|
@ -736,11 +750,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function save_sensor_config() {
|
function save_sensor_config() {
|
||||||
var next_callback = save_name;
|
|
||||||
|
|
||||||
SENSOR_CONFIG.acc_hardware = $('input[id="accHardwareSwitch"]').is(':checked') ? 0 : 1;
|
SENSOR_CONFIG.acc_hardware = $('input[id="accHardwareSwitch"]').is(':checked') ? 0 : 1;
|
||||||
SENSOR_CONFIG.baro_hardware = $('input[id="baroHardwareSwitch"]').is(':checked') ? 0 : 1;
|
SENSOR_CONFIG.baro_hardware = $('input[id="baroHardwareSwitch"]').is(':checked') ? 0 : 1;
|
||||||
SENSOR_CONFIG.mag_hardware = $('input[id="magHardwareSwitch"]').is(':checked') ? 0 : 1;
|
SENSOR_CONFIG.mag_hardware = $('input[id="magHardwareSwitch"]').is(':checked') ? 0 : 1;
|
||||||
|
|
||||||
|
var next_callback = save_name;
|
||||||
MSP.send_message(MSPCodes.MSP_SET_SENSOR_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_SENSOR_CONFIG), false, next_callback);
|
MSP.send_message(MSPCodes.MSP_SET_SENSOR_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_SENSOR_CONFIG), false, next_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue