diff --git a/eventPage.js b/eventPage.js index cc8643af3a..6dcba9ca5f 100644 --- a/eventPage.js +++ b/eventPage.js @@ -12,7 +12,7 @@ */ 'use strict'; -function start_app() { +function startApplication() { var applicationStartTime = new Date().getTime(); chrome.app.window.create('main.html', { @@ -73,9 +73,7 @@ function start_app() { }); } -chrome.app.runtime.onLaunched.addListener(function () { - start_app(); -}); +chrome.app.runtime.onLaunched.addListener(startApplication); chrome.runtime.onInstalled.addListener(function (details) { if (details.reason == 'update') { @@ -107,6 +105,6 @@ chrome.runtime.onInstalled.addListener(function (details) { chrome.notifications.onButtonClicked.addListener(function (notificationId, buttonIndex) { if (notificationId == 'baseflight_update') { - start_app(); + startApplication(); } }); \ No newline at end of file diff --git a/js/msp.js b/js/msp.js index 55807c1c0a..74f023b661 100644 --- a/js/msp.js +++ b/js/msp.js @@ -540,16 +540,16 @@ var MSP = { } var obj = {'code': code, 'callback': (callback_msp) ? callback_msp : false}; - obj.timer = setInterval(function() { + obj.timer = setInterval(function () { console.log('MSP data request timed-out: ' + code); - serial.send(bufferOut, function(sendInfo) {}); + serial.send(bufferOut, false); }, 1000); // we should be able to define timeout in the future MSP.callbacks.push(obj); - serial.send(bufferOut, function(sendInfo) { - if (sendInfo.bytesSent > 0) { + serial.send(bufferOut, function (sendInfo) { + if (sendInfo.bytesSent == bufferOut.length) { if (callback_sent) callback_sent(); } });