Parser library for Ingics BLE beacon and beacon gateway products.
npm install --save ingics/ingics-message-parser
Link package to local npm store, under message-parser folder
npm link
Link parser library to your project
npm link @ingics/message-parser
const parser = require('@ingics/message-parser');
// payload string got from Ingics beacon (for example: iBS01T)
const payload = '02010612FF590080BCD200000E161600FFFFFFFFFFFF';
// send it to parser and print out the result
console.log(parser.parsePayload(payload);
ad {
raw:
<Buffer 02 01 06 12 ff 59 00 80 bc d2 00 00 0e 16 16 00 ff ff ff ff ff ff>,
flags: 6,
localName: undefined,
txPowerLevel: undefined,
manufacturerData:
msd {
raw: <Buffer 59 00 80 bc d2 00 00 0e 16 16 00 ff ff ff ff ff ff>,
mfg: 89,
company: 'Ingics',
code: 48256,
battery: 210,
events: {},
eventFlag: 0,
type: 'iBS01T',
temperature: 5646,
humidity: 22 },
serviceData: [],
serviceUuids: [],
serviceSolicitationUuids: [] }
const parser = require('@ingics/message-parser');
// message string got from Ingics Gateway (for example: iGS01S)
const message = '$GPRP,3C253BC92ABB,C0563D4FF278,-56,02010612FF590080BCD200000E161600FFFFFFFFFFFF';
// send it to parser and print out the result
parser.parseMessage(message, (data) => {
console.log(data);
});
{ type: 'GPRP',
beacon: '3C253BC92ABB',
gateway: 'C0563D4FF278',
rssi: -56,
fullMessage:
'$GPRP,3C253BC92ABB,C0563D4FF278,-56,02010612FF590080BCD200000E161600FFFFFFFFFFFF',
timestamp: 1589449428889,
advertisement:
ad {
raw:
<Buffer 02 01 06 12 ff 59 00 80 bc d2 00 00 0e 16 16 00 ff ff ff ff ff ff>,
flags: 6,
localName: undefined,
txPowerLevel: undefined,
manufacturerData:
msd {
raw: <Buffer 59 00 80 bc d2 00 00 0e 16 16 00 ff ff ff ff ff ff>,
mfg: 89,
company: 'Ingics',
code: 48256,
battery: 210,
events: {},
eventFlag: 0,
type: 'iBS01T',
temperature: 5646,
humidity: 22 },
serviceData: [],
serviceUuids: [],
serviceSolicitationUuids: [] } }
npm link
npm link @ingics/message-parser
node bin/parse.js message '$GPRP,3C253BC92ABB,C0563D4FF278,-56,02010612FF590080BCD200000E161600FFFFFFFFFFFF'
node bin/parse.js payload '02010612FF590080BCD200000E161600FFFFFFFFFFFF'