payloadmask

This commit is contained in:
Klaus K Wilting committed 2018-11-19 00:41:15 +01:00
1 parent bf62d448ac
commit 26082740af
11 files changed
+104 -58

No files matched your search

+2 -2
View File
@@ -23,7 +23,7 @@ function Decoder(bytes, port) {
if (port === 3) {
// device config data
return decode(bytes, [uint8, uint8, uint16, uint8, uint8, uint8, uint8, bitmap, version], ['lorasf', 'txpower', 'rssilimit', 'sendcycle', 'wifichancycle', 'blescantime', 'rgblum', 'flags', 'version']);
return decode(bytes, [uint8, uint8, uint16, uint8, uint8, uint8, uint8, bitmap, bitmap, version], ['lorasf', 'txpower', 'rssilimit', 'sendcycle', 'wifichancycle', 'blescantime', 'rgblum', 'flags', 'payloadmask', 'version']);
}
if (port === 4) {
@@ -157,7 +157,7 @@ var bitmap = function (byte) {
}
var i = bytesToInt(byte);
var bm = ('00000000' + Number(i).toString(2)).substr(-8).split('').map(Number).map(Boolean);
return ['adr', 'screensaver', 'screen', 'countermode', 'blescan', 'antenna', 'filter', 'gpsmode']
return ['adr', 'screensaver', 'screen', 'countermode', 'blescan', 'antenna', 'filter', 'alarm']
.reduce(function (obj, pos, index) {
obj[pos] = +bm[index];
return obj;