diff --git a/T1000/TTN/SenseCAP_T1000_TTN_Decoder.js b/T1000/TTN/SenseCAP_T1000_TTN_Decoder.js index 8044f1b..a3e1e8a 100644 --- a/T1000/TTN/SenseCAP_T1000_TTN_Decoder.js +++ b/T1000/TTN/SenseCAP_T1000_TTN_Decoder.js @@ -1,3 +1,6 @@ +// Added Longitude/ Latitude in decoded_payload in order to use ttnmapper.org +// 03.10.2023 / steffen@grau-zone.online + function decodeUplink (input) { const bytes = input['bytes'] const fport = parseInt(input['fPort']) @@ -37,7 +40,9 @@ function decodeUplink (input) { } } if (elements.length > 0) { - decoded.messages.push(elements) + elements.push(element); + if (element.measurementId === "4197") { decoded.longitude = element.measurementValue }; + if (element.measurementId === "4198") { decoded.latitude = element.measurementValue } } } // decoded.messages = measurement @@ -843,4 +848,4 @@ function loraWANV2PositiveDataFormat (str, divisor = 1) { let strReverse = bigEndianTransform(str) let str2 = toBinary(strReverse) return parseInt(str2, 2) / divisor -} \ No newline at end of file +}