1.0.5 • Published 6 years ago

sigsystem-payloads-sigpark v1.0.5

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

SigSystem Payloads - SigPark

SigPark payload parse library.

Installation

You can use this package on the server side as well as the client side.

Node.js:

npm install sigsystem-payloads-sigpark

Usage

var SigParkPayload = require('sigsystem-payloads-sigpark');
var payload = new SigParkPayload('00');
console.log(payload.getDownlinkPayload());

This will print the following

002F680C00030c30

CONFIG_REPORT_FRAME

var payload = new SigParkPayload('031200030c301c02001e82');
console.log(payload.getMessageData());

This will print the following

{ raw: { x: 0, y: 0, z: 0 },
     config: 
      { sensivity: 2,
        magneticSensivity: 0,
        dataType: 0,
        module: 1,
        worktime: [Array],
        timeConfirm: 30,
        timeInactivity: 7200 },
     timestamp: 540 } 
}

KEEP_ALIVE (status occupied)

var payload = new SigParkPayload('82');
console.log(payload.getMessageData());

This will print the following

{ 
	header: { type: 2, count: 0, battery: 0, status: 1 },
  data: { raw: { x: 0, y: 0, z: 0 } } 
}

KEEP_ALIVE (status empty)

var payload = new SigParkPayload('32');
console.log(payload.getMessageData());

This will print the following

{ 
	header: { type: 2, count: 6, battery: 0, status: 0 },
  data: { raw: { x: 0, y: 0, z: 0 } } 
}

INFO_FRAME_RAW_DATA (status empty)

var payload = new SigParkPayload('380096005f00b5272432680c');
console.log(payload.getMessageData());

This will print the following

{ 
	header: { type: 0, count: 7, battery: 0, status: 0 },
  data: 
   { raw: { x: 150, y: 95, z: 181 },
     temperature: 39,
     battery: 3.6,
     timestamp: 813106 } 
}

INFO_FRAME_RAW_DATA (status occupied)

var payload = new SigParkPayload('b0007d004c00a3282436680c');
console.log(payload.getMessageData());

This will print the following

{ 
	header: { type: 0, count: 6, battery: 0, status: 1 },
	data: 
   { raw: { x: 125, y: 76, z: 163 },
     temperature: 40,
     battery: 3.6,
     timestamp: 813110 } 
}

Project Example

https://github.com/Sigmais/SigPark-Server

Library


Built with


  • node: 8.11.2
  • npm: 6.1.0

Release Notes

1.0.0 (Jul 19, 2018)

  • all: first release
1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago