From 8fd6e93fe203ed0cbbf342866ed0125b35d7e30e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Garci=CC=81a=20Hierro?= Date: Fri, 6 Oct 2017 21:28:59 +0100 Subject: [PATCH] Fix decoding MSPv2 message codes with high byte != 0 OR the high byte of the MSPv2 code with the "code" variable rather than with this.message_length_expected. This wasn't caught earlier because it would work for MSPv2 commands with the high byte set to zero anyway. --- js/msp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/msp.js b/js/msp.js index 5d91a15f..b04d1127 100644 --- a/js/msp.js +++ b/js/msp.js @@ -165,7 +165,7 @@ var MSP = { this.state = this.decoder_states.CODE_V2_HIGH; break; case this.decoder_states.CODE_V2_HIGH: - this.message_length_expected |= data[i] << 8; + this.code |= data[i] << 8; this.state = this.decoder_states.PAYLOAD_LENGTH_V2_LOW; break; case this.decoder_states.PAYLOAD_LENGTH_JUMBO_LOW: