From 5a65d1719bdd2a9f057426ce7c6ccbfdfa7d21d0 Mon Sep 17 00:00:00 2001 From: sharjeelaziz Date: Wed, 30 Jun 2021 22:51:55 -0400 Subject: [PATCH] Updates to decoder function for new API endpoint. --- TTGO-TBeam-Tracker/README.md | 5 ++++- TTGO-TBeam-Tracker/console-decoders/mapper_decoder.js | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/TTGO-TBeam-Tracker/README.md b/TTGO-TBeam-Tracker/README.md index ab42775..0d7ff41 100644 --- a/TTGO-TBeam-Tracker/README.md +++ b/TTGO-TBeam-Tracker/README.md @@ -46,7 +46,7 @@ In summary, within the Arduino IDE open Boards Manager from Tools > Board menu a The specific details for adding a Mapper or Cargo integration use a different edge node device than the one detailed here. When prompted to add a function decoder, be sure to use the following decoder. Note: This decoder can also be found within this project in the console-decoders directory. -```C +```JS function Decoder(bytes, port) { var decoded = {}; @@ -63,6 +63,9 @@ function Decoder(bytes, port) { decoded.hdop = bytes[8] / 10.0; decoded.sats = bytes[9]; + + //additional required field + decoded.accuracy = 3; return decoded; } diff --git a/TTGO-TBeam-Tracker/console-decoders/mapper_decoder.js b/TTGO-TBeam-Tracker/console-decoders/mapper_decoder.js index 247e3db..1e3afa9 100644 --- a/TTGO-TBeam-Tracker/console-decoders/mapper_decoder.js +++ b/TTGO-TBeam-Tracker/console-decoders/mapper_decoder.js @@ -1,4 +1,3 @@ -// Decoder for TTGO_TBeam mapping function Decoder(bytes, port) { var decoded = {}; @@ -15,6 +14,9 @@ function Decoder(bytes, port) { decoded.hdop = bytes[8] / 10.0; decoded.sats = bytes[9]; + + //additional required field + decoded.accuracy = 3; return decoded; }