LBLEPeripheral
LBLEPeripheral is a singleton object representing the local BLE periphral device. Developers can use this object to create beacon devices or peripheral devices that stores characterstics.
There are several stages when using LBLEPeripheral:
Prepare characteristics and services: design what services and characteristics your device is going to have. Define these entities in the global scope:
Configuration: if you need to create a peripheral that can store characteristics, you need to create services. use addService() to add services into your peripheral.
Start the service framework by calling LBLEPeripheral.begin()
And finally broadcast your presense with LBLEPeripheral.advertise()
Methods
addService()
begin()
advertise()
advertiseAsBeacon()
stopAdvertise()
notifyAll()
configuring GATT Services. You must configure services before advertising the device. The services cannot change after being connected.
Syntax
Parameters
service: The service to be added into this peripheral. The service object is referenced instead of copied, so tt must be valid and alive all the time. It is recommended to define the service in global scope.
Returns
none
stop advertisement and clears advertisement data.
Syntax
Parameters
none
Returns
none
Last updated