CF/BF - Support configuration of iLAP transponder code.

More work is required to support ARCITIMER.
10.3.x-maintenance
Hydra 2017-04-01 19:58:38 +01:00 committed by Michael Keller
parent 19f320e2f6
commit 8c03de88c0
2 changed files with 37 additions and 3 deletions

View File

@ -296,7 +296,9 @@ var FC = {
TRANSPONDER = { TRANSPONDER = {
supported: false, supported: false,
data: [] data: [],
provider: 0,
providers: []
}; };
RC_DEADBAND_CONFIG = { RC_DEADBAND_CONFIG = {

View File

@ -986,9 +986,38 @@ MspHelper.prototype.process_data = function(dataHandler) {
console.log("Blackbox config saved"); console.log("Blackbox config saved");
break; break;
case MSPCodes.MSP_TRANSPONDER_CONFIG: case MSPCodes.MSP_TRANSPONDER_CONFIG:
TRANSPONDER.supported = (data.readU8() & 1) != 0; var bytesRemaining = data.byteLength;
if (semver.gte(CONFIG.apiVersion, "1.33.0")) {
var providerCount = data.readU8();
bytesRemaining--;
TRANSPONDER.supported = providerCount > 0;
TRANSPONDER.providers = [];
for (var i = 0; i < providerCount; i++) {
var provider = {
id: data.readU8(),
dataLength: data.readU8()
};
bytesRemaining -= 2;
TRANSPONDER.providers.push(provider);
}
TRANSPONDER.provider = data.readU8();
bytesRemaining--;
} else {
TRANSPONDER.supported = (data.readU8() & 1) != 0;
bytesRemaining--;
// only ILAP was supported prior to 1.33.0
TRANSPONDER.providers = [{
id: 1, // ILAP
dataLength: 6
}];
TRANSPONDER.provider = TRANSPONDER.providers[0].id;
}
TRANSPONDER.data = []; TRANSPONDER.data = [];
var bytesRemaining = data.byteLength - 1;
for (var i = 0; i < bytesRemaining; i++) { for (var i = 0; i < bytesRemaining; i++) {
TRANSPONDER.data.push(data.readU8()); TRANSPONDER.data.push(data.readU8());
} }
@ -1256,6 +1285,9 @@ MspHelper.prototype.crunch = function(code) {
break; break;
case MSPCodes.MSP_SET_TRANSPONDER_CONFIG: case MSPCodes.MSP_SET_TRANSPONDER_CONFIG:
if (semver.gte(CONFIG.apiVersion, "1.33.0")) {
buffer.push8(TRANSPONDER.provider); //
}
for (var i = 0; i < TRANSPONDER.data.length; i++) { for (var i = 0; i < TRANSPONDER.data.length; i++) {
buffer.push8(TRANSPONDER.data[i]); buffer.push8(TRANSPONDER.data[i]);
} }