Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions T1000/TTN/SenseCAP_T1000_TTN_Decoder.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Added Longitude/ Latitude in decoded_payload in order to use ttnmapper.org
// 03.10.2023 / [email protected]

function decodeUplink (input) {
const bytes = input['bytes']
const fport = parseInt(input['fPort'])
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -843,4 +848,4 @@ function loraWANV2PositiveDataFormat (str, divisor = 1) {
let strReverse = bigEndianTransform(str)
let str2 = toBinary(strReverse)
return parseInt(str2, 2) / divisor
}
}