lwm2m-codec
A codec for lightweight M2M (LWM2M) data formats.
Documentation
Please visit the Wiki.
Overview
A codec for lightweight M2M (LWM2M) data formats.
Installation
$ npm install lwm2m-codec --save
Usage
TLV:
var lwCodec = ; lwCodec;lwCodec;lwCodec;// Buffer <0x08, 0x00, 0x0b, 0xe4, 0x16, 0x44, 0x41, 0xf8, 0x00, 0x00, 0xe1, 0x16, 0x45, 0x63>; lwCodec;// { sensorValue: 31, units: 'c' }
JSON:
var lwCodec = ; lwCodec;lwCodec;lwCodec;// Buffer <7b 22 62 6e 22 3a 22 2f 33 33 30 33 2f 30 22 2c 22 65 22 3a 5b 7b 22 6e 22 3a 22 35 37 30 30 22 2c 22 76 22 3a 33 31 7d 2c 7b 22 6e 22 3a 22 35 37 30 31 22 2c 22 73 76 22 3a 22 63 22 7d 5d 7d 0d>;// String {"bn":"/3303/0","e":[{"n":"5700","v":31},{"n":"5701","sv":"c"}]} lwCodec;// { sensorValue: 31, units: 'c' }
License
Licensed under MIT.