Gateway TLG8411V1 User Manual V1.0.0
37
July 2020
rfch:0,
powe:14,
modu:"LORA",
datr:"SF7BW125",
codr:"4/6",
ipol:false,
size:5,
data:""
};
var beacon_pkt;
function onInit() {
beacon_pkt = new Uint8Array(5);
beacon_pkt[0] = 0x5A; //magic
beacon_pkt[1] = 0x00; //sequence
beacon_pkt[2] = 0x00; //cmd
beacon_pkt[3] = 0x00; //node address
beacon_pkt[4] = 0x00; //data
dgram = require('dgram');
udp_sock = dgram.createSocket('udp4');
cmd_sock = dgram.createSocket('udp4');
cmd_sock.on('listening', function () {
var address = cmd_sock.address();
debug_print('UDP Server listening on ' + address.a ':' +
address.port);
});
cmd_sock.on('message', function (message, remote) {
debug_print(remote.a ':' + remote.port +' - ' + message);
cmd_node_address = message[0];
cmd_node_data = message[1];
update_cmd = true;
});
cmd_sock.bind(cmd_port);
setInterval(beacon, 10000); //broadcast beacon every 10 second
}
function onLoRaRx (data) {
var recv_pkt = JSON.parse(data);
var recv_data = new Buffer(recv_pkt.data, 'base64');
debug_print("Receive packet from freq:" + recv_pkt.freq +
", datarate:" + recv_pkt.datr + ", coderate:" + recv_pkt.codr);
Содержание TLG8411V1
Страница 1: ...Gateway TLG8411V1 User Manual V1 0 0 July 2020 ...
Страница 36: ...Gateway TLG8411V1 User Manual V1 0 0 35 July 2020 Figure 4 2 Execution of Parsing LoRaWAN Packet in LoRaScript ...
Страница 52: ...Gateway TLG8411V1 User Manual V1 0 0 51 July 2020 8 Revisions 8 1 V1 0 0 First Release Version ...