SimpleJSBLE
Examples
Runnable SimpleJSBLE examples for Node.js that list adapters, scan, connect, read, write, receive notifications, host a GATT service and use a Dongl.
The examples live alongside the other SimpleBLE binding examples:
- list_adapters: Enumerate adapters and print names, addresses, and power state.
- list_backends: Enumerate backends and list the adapters provided by each one.
- power_cycle: Turn each adapter off and on again.
- scan: Discover peripherals and print their names, addresses, and signal strength.
- connect: Connect to a peripheral and list its services and characteristics.
- read: Connect to a peripheral and read a GATT characteristic.
- write: Connect to a peripheral and write text to a GATT characteristic.
- notify: Connect to a peripheral and print the notifications of a characteristic.
- peripheral: Host a GATT service that echoes writes to subscribed clients.
- dongl: Scan with a Dongl adapter, then connect and answer pairing requests.
Build SimpleJSBLE from the checkout, then run an example from
examples/simplejsble:
cd simplejsble
npm ci
npm run build
cd ../examples/simplejsble
npm install
node scan.jsFor binding development, see the contributor guide. For events, lifetime, and handlers, see Usage.
Usage
Install SimpleJSBLE from npm and use SimpleBLE from Node.js and Electron to scan, connect, use GATT, host a local peripheral and configure backends.
Usage
Install SimpleKtBLE, the Kotlin Multiplatform binding for SimpleBLE, and use it on Android, iOS, macOS, Windows and Linux to scan, connect and host services.
