Just a BLE wrapper for my own use.
This is currently under development and may not work properly until it reaches v1.0.0
. Therefore, it is not recommended for use at this time.
- Declare
BLECharacteristic*
s as global variables. - In your
setup()
,- Call
LB.begin(deviceName)
to initialize BLE. - Create
BLEService
instances usingLB.createService(serviceUUID)
. - Add
BLECharacteristic
s to the service usingLB.addCharacteristic(service, characteristicUUID)
, and assign the returned values to the variables you declared before. - Start advertising using
LB.startAdvertising()
.
- Call
- In your
loop()
, you can use the characteristics as you like.
For more details, check out the examples.
If you want to try the basic example, replace board
under [env]
in platformio.ini
with the board you have, and then execute pio run -e basic -t upload
.
Note that I am using the M5 series, so the examples are specific to them.
MIT