www.dragino.com
LSN50 LoRa Sensor Node User Manual
18
/
60
2.3.5
Decode payload in The Things Network
While using TTN network, you can add the payload format to decode the payload.
The payload decoding function is as follows:
function Decoder(bytes, port) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
if(bytes[6] & 0x10)
{
var mod4="3DS18B20"; //work mode
}
else if(bytes[6] & 0x08)
{
var mod3="3ADC"; //work mode