From 56a209a1e8ef01a6db9ea234cb74ae2209fa8d49 Mon Sep 17 00:00:00 2001 From: ProDrone Date: Sun, 5 Jul 2015 00:21:14 +0200 Subject: [PATCH] Detect and register unsupported message error from FC --- js/msp.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/msp.js b/js/msp.js index 49676381..8415d8c9 100644 --- a/js/msp.js +++ b/js/msp.js @@ -105,6 +105,7 @@ var MSP = { callbacks: [], packet_error: 0, + unsupported: 0, ledDirectionLetters: ['n', 'e', 's', 'w', 'u', 'd'], // in LSB bit order ledFunctionLetters: ['i', 'w', 'f', 'a', 't', 'r', 'c'], // in LSB bit order @@ -141,10 +142,14 @@ var MSP = { } break; case 2: // direction (should be >) + this.unsupported = 0; if (data[i] == 62) { // > this.message_direction = 1; - } else { // < + } else if (data[i] == 60) { // < this.message_direction = 0; + } else if (data[i] == 33) { // ! + // FC reports unsupported message error + this.unsupported = 1; } this.state++;