Bugfix: Correct payload decoder
This commit is contained in:
parent
3f1cf278e9
commit
380f984253
1 changed files with 5 additions and 2 deletions
|
@ -7,10 +7,13 @@ const offset_lng = (32 / 8) + (32 / 8);
|
|||
function decode_payload(payload_base64) {
|
||||
let payload_buffer = Buffer.from(payload_base64, "base64");
|
||||
|
||||
// console.debug(`Offsets: ${offset_id}, ${offset_lat}, ${offset_lng}`);
|
||||
// console.debug(`Message hex: ${payload_buffer.toString("hex")}`)
|
||||
|
||||
return {
|
||||
id: payload_buffer.readUInt32LE(offset_id),
|
||||
latitude: patload_buffer.readFloatLE(offset_lat),
|
||||
longitude: patload_buffer.readFloatLE(offset_lng)
|
||||
latitude: payload_buffer.readFloatLE(offset_lat),
|
||||
longitude: payload_buffer.readFloatLE(offset_lng)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue