New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

xiaomi-gap

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xiaomi-gap

Xiaomi GAP sensor data reader

latest
npmnpm
Version
1.0.1
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

xiaomi-gap

Xiaomi GAP sensor data parser

Used for parsing data frames from Xiaomi Mijia brand BLE sensors

API

readServiceData

In: Buffer|Array|String

Out:

result = {
	productId: Number,
	counter: Number,
	frameControl: [],
	mac: String, // Optional,
	capability: CapabilityBitMask, // Optional
	event: {
		eventID: Number,
		length: Number,
		raw: String,
		data: Object,
	} // Optional
}

CapabilityBitMask:

BitNameExplanation
0ConnectableTrue of device is cabable of establishing a connection
1beCentralTrue of device is cabable of serving as a central device
2securityTrue of device is capable of data encryption
3-4bonding00 - No MIOT binding, 01 - before MIOT binding, 10 - after MIOT binding

Usage

To use this library you need to be able to discover the Xiaomi sensor advertising and then pass the Xiaomi service data (0xfe95) to it as a Buffer. For full example, see example.js.

Supported sensors

Xiaomi Mijia Bluetooth Temperature and Humidity sensor (with LCD)

This sensor is fully supported in normal operation. Library is able to read Temperature, Humidity and battery levels from frames.

Sources

Sources used during this project are official Xiaomi MIOT documents available on their site

FAQs

Package last updated on 31 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts