From b6937b3c973c4f426cdbe3275a93e098051a61d6 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sat, 23 Jun 2018 13:42:01 +0200 Subject: [PATCH] packed_decoder.js small corrections --- src/TTN/packed_decoder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TTN/packed_decoder.js b/src/TTN/packed_decoder.js index d6f43ed0..f18b4ab0 100644 --- a/src/TTN/packed_decoder.js +++ b/src/TTN/packed_decoder.js @@ -36,7 +36,7 @@ function Decoder(bytes, port) { var bytesToInt = function (bytes) { var i = 0; for (var x = 0; x < bytes.length; x++) { - i |= +(bytes[x] << (x * 8)); + i |= (bytes[x] << (x * 8)); } return i; }; @@ -124,7 +124,7 @@ var bitmap = function (byte) { var bm = ('00000000' + Number(i).toString(2)).substr(-8).split('').map(Number).map(Boolean); return ['adr', 'screensaver', 'screen', 'countermode', 'blescan', 'antenna', 'filter', 'gpsmode'] .reduce(function (obj, pos, index) { - obj[pos] = bm[index]; + obj[pos] = +bm[index]; return obj; }, {}); };