From 717025cbdea195cbf6f34841e41e9c5038f23341 Mon Sep 17 00:00:00 2001 From: ProDrone Date: Sun, 5 Jul 2015 00:40:50 +0200 Subject: [PATCH] Skip and log unsupported messages --- js/msp.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/msp.js b/js/msp.js index 8415d8c9..2d2b4915 100644 --- a/js/msp.js +++ b/js/msp.js @@ -210,7 +210,7 @@ var MSP = { process_data: function (code, message_buffer, message_length) { var data = new DataView(message_buffer, 0); // DataView (allowing us to view arrayBuffer as struct/union) - switch (code) { + if (!this.unsupported) switch (code) { case MSP_codes.MSP_IDENT: console.log('Using deprecated msp command: MSP_IDENT'); // Deprecated @@ -839,6 +839,8 @@ var MSP = { default: console.log('Unknown code detected: ' + code); + } else { + console.log('FC reports unsupported message error: ' + code); } // trigger callbacks, cleanup/remove callback after trigger