1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 00:35:20 +03:00

retry on timeout mechanism

This commit is contained in:
Pawel Spychalski (DzikuVx) 2017-01-20 20:34:24 +01:00
parent ba165a0f14
commit 9594880041
3 changed files with 31 additions and 2 deletions

View file

@ -40,7 +40,18 @@ helper.mspQueue = (function (serial, MSP) {
*/
privateScope.portInUse = true;
//TODO implement timeout scenario
request.timer = setTimeout(function () {
console.log('MSP data request timed-out: ' + request.code);
/*
* Remove current callback
*/
MSP.removeCallback(request.code);
/*
* Create new entry in the queue
*/
publicScope.put(request);
}, serial.getTimeout());
/*
* Set receive callback here