TTN Smart Sensor (Aquascope)

Sensor

Codec Description

Codec for Aquascope

Codec Preview

function decodeUplink(input) { var t = input.bytes[2]*0xff+input.bytes[3] switch (input.fPort) { case 10: return { // Decoded data data: { leak: input.bytes[0] & 0x01 , remote: (input.bytes[0] & 0x02)?1:0 , battery: input.bytes[1], temperature: t }, }; case 16: return { // Decoded data data: { battery: input.bytes[1], temperature: t }, }; default: return { errors: ['unknown FPort'], }; } } 

This codec is sourced from The Things Network. All rights belong to The Things Network.

This codec is licensed under the GNU General Public License v3 (GPL v3). Modifications, if any, are clearly marked. You are free to use, modify, and distribute the codec under the terms of GPL v3.

Community Feedback