Skip to content
/ simble Public

SIMple access to BLE (Bluetooth Low Energy = Bluetooth 4.x) devices

Notifications You must be signed in to change notification settings

oyooyo/simble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simble

A node.js module for simple access to ble (Bluetooth Low Energy = Bluetooth 4.x) devices.

This module is a wrapper for the noble package, using Promises instead of callbacks and providing a somewhat different API.

Usage example

The following code scans for a nearby Bluetooth LE peripheral that advertises the "Heart Rate" Service (ID: 0x180D). If such a peripheral is found, it requests the peripheral's "Heart Rate Measurement" Characteristic (ID: 0x2A37) (the peripheral will auto-connect, since a connection is required for accessing/requesting a Characteristic). It then subscribes to that characteristic; whenever updates arrive, it will print the current heart rate (byte 1 in the data) to the console.

require('simble').subscribe_to_characteristic(0x180D, 0x2A37, (heart_rate_data) => {
  console.log(`Heart rate: ${data[1]} bpm`);
});

API

Unfortunately, the API is not documented yet, so there's very little reason for others to use it yet. I published it because other node.js modules of mine require it.

About

SIMple access to BLE (Bluetooth Low Energy = Bluetooth 4.x) devices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published