mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-24 08:45:26 +03:00
hardware roundtrip
This commit is contained in:
parent
019fb3e851
commit
e76612a4cc
5 changed files with 25 additions and 33 deletions
34
js/msp.js
34
js/msp.js
|
@ -185,42 +185,12 @@ var MSP = {
|
|||
'callback': (callback_msp) ? callback_msp : false,
|
||||
'onSend': callback_sent,
|
||||
'timer': false,
|
||||
'created': new Date().getTime()
|
||||
'created': new Date().getTime(),
|
||||
'sentOn': null
|
||||
};
|
||||
|
||||
helper.mspQueue.put(obj);
|
||||
|
||||
// var requestExists = false;
|
||||
// for (i = 0; i < MSP.callbacks.length; i++) {
|
||||
// if (i < MSP.callbacks.length) {
|
||||
// if (MSP.callbacks[i].code == code) {
|
||||
// // request already exist, we will just attach
|
||||
// requestExists = true;
|
||||
// break;
|
||||
// }
|
||||
// } else {
|
||||
// console.log("Callback index error: "+ i);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (!requestExists) {
|
||||
// obj.timer = setInterval(function () {
|
||||
// console.log('MSP data request timed-out: ' + code);
|
||||
//
|
||||
// serial.send(bufferOut, false);
|
||||
// }, serial.getTimeout()); // we should be able to define timeout in the future
|
||||
// }
|
||||
|
||||
// MSP.callbacks.push(obj);
|
||||
|
||||
// always send messages with data payload (even when there is a message already in the queue)
|
||||
// if (data || !requestExists) {
|
||||
// serial.send(bufferOut, function (sendInfo) {
|
||||
// if (sendInfo.bytesSent == bufferOut.byteLength) {
|
||||
// if (callback_sent) callback_sent();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
return true;
|
||||
},
|
||||
promise: function(code, data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue