Examples
Runnable Bluetooth client and GATT hosting examples for SimpleJSBLE.
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.
