mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-19 22:35:15 +03:00
Prevent Configurator from being used with other firmware than INAV
This commit is contained in:
parent
4e2f65eca6
commit
395c413992
2 changed files with 30 additions and 18 deletions
|
@ -156,6 +156,9 @@
|
|||
"firmwareVersionNotSupported": {
|
||||
"message": "This firmware version is <span style=\"color: red\">not supported</span>. Please upgrade to firmware that supports api version <strong>$1</strong> or higher. Use CLI for backup before flashing. CLI backup/restore procedure is in the documention."
|
||||
},
|
||||
"firmwareVariantNotSupported": {
|
||||
"message": "This firmware variant is <span style=\"color: red\">not supported</span>. Please upgrade to INAV firmware. Use CLI for backup before flashing. CLI backup/restore procedure is in the documention."
|
||||
},
|
||||
|
||||
"tabSwitchConnectionRequired": {
|
||||
"message": "You need to <strong>connect</strong> before you can view any of the tabs."
|
||||
|
|
|
@ -193,34 +193,43 @@ function onOpen(openInfo) {
|
|||
googleAnalytics.sendEvent('Firmware', 'Variant', CONFIG.flightControllerIdentifier + ',' + CONFIG.flightControllerVersion);
|
||||
GUI.log(chrome.i18n.getMessage('fcInfoReceived', [CONFIG.flightControllerIdentifier, CONFIG.flightControllerVersion]));
|
||||
|
||||
MSP.send_message(MSP_codes.MSP_BUILD_INFO, false, false, function () {
|
||||
if (CONFIG.flightControllerIdentifier == 'INAV') {
|
||||
|
||||
googleAnalytics.sendEvent('Firmware', 'Using', CONFIG.buildInfo);
|
||||
GUI.log(chrome.i18n.getMessage('buildInfoReceived', [CONFIG.buildInfo]));
|
||||
MSP.send_message(MSP_codes.MSP_BUILD_INFO, false, false, function () {
|
||||
|
||||
MSP.send_message(MSP_codes.MSP_BOARD_INFO, false, false, function () {
|
||||
googleAnalytics.sendEvent('Firmware', 'Using', CONFIG.buildInfo);
|
||||
GUI.log(chrome.i18n.getMessage('buildInfoReceived', [CONFIG.buildInfo]));
|
||||
|
||||
googleAnalytics.sendEvent('Board', 'Using', CONFIG.boardIdentifier + ',' + CONFIG.boardVersion);
|
||||
GUI.log(chrome.i18n.getMessage('boardInfoReceived', [CONFIG.boardIdentifier, CONFIG.boardVersion]));
|
||||
MSP.send_message(MSP_codes.MSP_BOARD_INFO, false, false, function () {
|
||||
|
||||
MSP.send_message(MSP_codes.MSP_UID, false, false, function () {
|
||||
GUI.log(chrome.i18n.getMessage('uniqueDeviceIdReceived', [CONFIG.uid[0].toString(16) + CONFIG.uid[1].toString(16) + CONFIG.uid[2].toString(16)]));
|
||||
googleAnalytics.sendEvent('Board', 'Using', CONFIG.boardIdentifier + ',' + CONFIG.boardVersion);
|
||||
GUI.log(chrome.i18n.getMessage('boardInfoReceived', [CONFIG.boardIdentifier, CONFIG.boardVersion]));
|
||||
|
||||
// continue as usually
|
||||
CONFIGURATOR.connectionValid = true;
|
||||
GUI.allowedTabs = GUI.defaultAllowedTabsWhenConnected.slice();
|
||||
if (semver.lt(CONFIG.apiVersion, "1.4.0")) {
|
||||
GUI.allowedTabs.splice(GUI.allowedTabs.indexOf('led_strip'), 1);
|
||||
}
|
||||
MSP.send_message(MSP_codes.MSP_UID, false, false, function () {
|
||||
GUI.log(chrome.i18n.getMessage('uniqueDeviceIdReceived', [CONFIG.uid[0].toString(16) + CONFIG.uid[1].toString(16) + CONFIG.uid[2].toString(16)]));
|
||||
|
||||
GUI.canChangePidController = semver.gte(CONFIG.apiVersion, CONFIGURATOR.pidControllerChangeMinApiVersion);
|
||||
// continue as usually
|
||||
CONFIGURATOR.connectionValid = true;
|
||||
GUI.allowedTabs = GUI.defaultAllowedTabsWhenConnected.slice();
|
||||
if (semver.lt(CONFIG.apiVersion, "1.4.0")) {
|
||||
GUI.allowedTabs.splice(GUI.allowedTabs.indexOf('led_strip'), 1);
|
||||
}
|
||||
|
||||
onConnect();
|
||||
GUI.canChangePidController = semver.gte(CONFIG.apiVersion, CONFIGURATOR.pidControllerChangeMinApiVersion);
|
||||
|
||||
$('#tabs ul.mode-connected .tab_setup a').click();
|
||||
onConnect();
|
||||
|
||||
$('#tabs ul.mode-connected .tab_setup a').click();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
GUI.log(chrome.i18n.getMessage('firmwareVariantNotSupported'));
|
||||
CONFIGURATOR.connectionValid = true; // making it possible to open the CLI tab
|
||||
GUI.allowedTabs = ['cli'];
|
||||
onConnect();
|
||||
$('#tabs .tab_cli a').click();
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue