LoRaPacket
LoRa WAN Packet decoder / encoder. For the moment it implements the LoRa WAN v1.0.2 standard.
Install
npm install lorapacket
Usage
Here are a few usage examples, for more please use the full documentation.
Decode data (buffer or string)
var LoRaPacket = ; var nwkSKey = ;var appSKey = ; // from Buffervar bufferData = ; var packet = bufferData nwkSKey appSKey encoding: 'hex'; // from Stringvar bufferData = ; var packet = bufferData nwkSKey appSKey encoding: 'hex' encoding: 'base64';
Encode data
var LoRaPacket = ; var nwkSKey = ;var appSKey = ; var packet = mtype: LoRaPacketMTYPEMTYPE_UNCONFIRMEWD_DOWNLINK devAddr: '010A020A' fCtrl: adr: 0) adrAckReq: 0 ack: 0 pending: 0 fOptsLen: 0 fCnt: 1 fPort: 2 frmPayload: 'packet buffer' nwkSKey appSKey encoding: 'hex' ;
© 2017 Wyliodrin SRL