From 5f8de31fa442f1a479b957c8f606999c3b287811 Mon Sep 17 00:00:00 2001 From: cheetah Date: Mon, 29 Mar 2021 17:49:48 +0200 Subject: [PATCH] Update and rename testing.js to testing.ttnv2.js --- .../{testing.js => testing.ttnv2.js} | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) rename birdy-slim-iot/payload-formatters/{testing.js => testing.ttnv2.js} (83%) diff --git a/birdy-slim-iot/payload-formatters/testing.js b/birdy-slim-iot/payload-formatters/testing.ttnv2.js similarity index 83% rename from birdy-slim-iot/payload-formatters/testing.js rename to birdy-slim-iot/payload-formatters/testing.ttnv2.js index 3e5c766..a5a50a8 100644 --- a/birdy-slim-iot/payload-formatters/testing.js +++ b/birdy-slim-iot/payload-formatters/testing.ttnv2.js @@ -4,7 +4,7 @@ function Decoder(bytes, port) { return a.map(function(x){ return String.fromCharCode(x) }).join('') // because very OLD js parser } switch (port) { - case 1: // Technical Received Acknowledgment '|5||C|'' + case 1: // Technical Received Acknowledgment '|5||C|' // 31 32 33 34 35 20 data.type = 'ack' data.ack = 'recv' @@ -22,7 +22,13 @@ function Decoder(bytes, port) { data.operationalData = bytesToString(bytes) } break; - case 5: // GPS Tracking Port + case 3: // Status & Canned Messages + + break; + case '4': // Battery and Power Notifications + SOS Trigger + + break; + case 5: // GPS Tracking Port '|G|' data.type = 'gps' data.latitude = ((bytes[0]<<24)>>>0) + ((bytes[1]<<16)>>>0) + ((bytes[2]<<8)>>>0) + bytes[3] data.latitude /= 10e4