noble / bleno

A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals
MIT License
2.12k stars 448 forks source link

Implementing BLE peripheral with authorization on a given characteristic #451

Open cryptax opened 4 years ago

cryptax commented 4 years ago

BLE supports authorization for given characteristics (process during which I am allowed or not to access the characteristic). For example, below, I do not have the correct authorization to read the handle (output from gatttool):

[aa:a7:bb:76:33:22][LE]> char-read-hnd 0x001c
Error: Characteristic value/descriptor read failed: Attribute requires authorization before read/write

Note this is different from authentication. Authentication is done during pairing. Here I talk about authorization (see here for "authorization"). Just want to insist I am not talking about authentication ;-)

Is this supported by bleno, and how could we implement a peripheral that requires authorization?