codie-packet
Unofficial Node.js library for creating and parsing Codie packets based on Codie BLE API documentation
Install
You can get codie-packet via npm.
$ npm install codie-packet --save
Usage
Forge a packet for Codie:
var CodiePacket = ; var buffer = CodiePacket; /* Send buffer to the BLE layer */
Parse a packet received from Codie:
var CodiePacket = ; var buffer = /* Receive buffer from the BLE layer */ var packet = CodiePacket; // for example:packet == source: CodiePacketENTITYMCU destination: CodiePacketENTITYAPP priority: CodiePacketPRIORITYNORMAL sequenceNumber: 1337 commandId: CodiePacketCOMMANDSDRIVE_DISTANCE data: 0;
For detailed description of ENTITY, PRIORITY and COMMANDS constants see Codie BLE API documentation, everything is the same just in UPPER_CASE.