From a132f62437996d14e8ce395b4241f8bfe585a4bd Mon Sep 17 00:00:00 2001 From: cheetah Date: Tue, 30 Mar 2021 19:29:46 +0200 Subject: [PATCH] Update testing.ttnv2.js --- birdy-slim-iot/payload-formatters/testing.ttnv2.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/birdy-slim-iot/payload-formatters/testing.ttnv2.js b/birdy-slim-iot/payload-formatters/testing.ttnv2.js index 98aa90c..e6d6686 100644 --- a/birdy-slim-iot/payload-formatters/testing.ttnv2.js +++ b/birdy-slim-iot/payload-formatters/testing.ttnv2.js @@ -23,7 +23,17 @@ function Decoder(bytes, port) { } break; case 3: // Status & Canned Messages + // Canned Message '01' --- '05', single Hex Number, incrementing + // Status '|Z|' or if no CenterSelection '00' + if (bytes.length == 1) { + data.type = 'cannedMessage' + data.cannedMessage = bytes[0] * 1 + } else { + data.type = 'status' + data.status = bytes[0] * 1 + data.selection = bytes[1] * 2 + } break; case 4: // Battery and Power Notifications // Startup 'FF'