mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-16 04:45:18 +03:00
verify version on connect
This commit is contained in:
parent
0101f753f9
commit
d5b64cb291
2 changed files with 13 additions and 6 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
var firmware_version_accepted = 2.3;
|
||||||
|
|
||||||
var CONFIG = {
|
var CONFIG = {
|
||||||
version: 0,
|
version: 0,
|
||||||
multiType: 0,
|
multiType: 0,
|
||||||
|
|
|
@ -150,12 +150,17 @@ function onOpen(openInfo) {
|
||||||
send_message(MSP_codes.MSP_IDENT, MSP_codes.MSP_IDENT, false, function() {
|
send_message(MSP_codes.MSP_IDENT, MSP_codes.MSP_IDENT, false, function() {
|
||||||
GUI.timeout_remove('connecting'); // kill connecting timer
|
GUI.timeout_remove('connecting'); // kill connecting timer
|
||||||
|
|
||||||
// Update UI elements that doesn't need consistent refreshing
|
if (CONFIG.version >= firmware_version_accepted) {
|
||||||
$('.software-version').html(CONFIG.version);
|
// Update UI elements that doesn't need consistent refreshing
|
||||||
|
$('.software-version').html(CONFIG.version);
|
||||||
configuration_received = true;
|
|
||||||
$('div#port-picker a.connect').text('Disconnect').addClass('active');
|
configuration_received = true;
|
||||||
$('#tabs li a:first').click();
|
$('div#port-picker a.connect').text('Disconnect').addClass('active');
|
||||||
|
$('#tabs li a:first').click();
|
||||||
|
} else {
|
||||||
|
GUI.log('This firmware version is <span style="color: red">not supported</span>. Please upgrade to version <strong>' + firmware_version_accepted + '</strong> or higher.');
|
||||||
|
$('div#port-picker a.connect').click(); // disconnect
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue