mipacket
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

mipacket

Node.js package for parsing Xiaomi BLE packets.

npm language commit licence


Install

npm install mipacket

Usage

import MiPacket from 'mipacket';

const packet = new MiPacket(buffer);
// or
const packet = new MiPacket('hexstring');

Sample output

MiPacket {
  isEncrypted: false,
  hasMac: true,
  hasCapabilities: false,
  hasEvent: true,
  hasMesh: false,
  isRegistered: false,
  bindingState: false,
  authMode: 0,
  version: 2,
  productId: 426,
  productName: 'LYWSDCGQ',
  frameCounter: 72,
  mac: <Buffer 12 34 56 78 90 ab>,
  event: Event {
    eventId: 13,
    eventData: {
      temperature: 19.4,
      humidity: 66
    }
  }
}

References

Licence

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i mipacket

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

18.6 kB

Total Files

6

Last publish

Collaborators

  • chrisscheffler