LBLEAdvertisementData

This helper class helps to configure and parse BLE GAP advertisement packets.

BLE peripherals advertises information about their capabilities and other information in advertisement packets. The packet is of finite length, but the format is very flexible.

This class helps you to create several common advertisement formats, e.g. ibeacon:

LBLEAdvertisementData beaconData;
// This is a common AirLocate example UUID.
LBLEUuid uuid("E2C56DB5-DFFB-48D2-B060-D0F5A71096E0");
beaconData.configAsIBeacon(uuid, 01, 02, -40);

You can then simply call LBLEPeripheral.advertise to start advertise.

Constructors

LBLEAdvertisementData()

Creates an LBLEAdvertisementData instance.

Syntax

Parameters

none

Returns

none

Methods

configAsConnectableDevice()

configAsEddystoneURL()

configAsIBeacon()

Create an advertisement that allows BLE centrals, e.g. smartphones, to connect to this device.

This methods RESETS all the advertisement data fields

Note that you need to define corresponding GATT services with LBLEPeripheral before start advertising your device.

Syntax

Parameters

deviceName: must be shorter than 27 bytes.

serviceUUID: service UUID to be included in advertisement.

Returns

none

Last updated