> For the complete documentation index, see [llms.txt](https://cavedu.gitbook.io/linkit-7697/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cavedu.gitbook.io/linkit-7697/linkit-7697-development-guide-for-arduino-ide/developer-guide/using-bluetooth/lble-library-api-guide/lbleadvertisementdata.md).

# 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 <a href="#lbleadvertisementdata-constructors" id="lbleadvertisementdata-constructors"></a>

&#x20;LBLEAdvertisementData()

{% tabs %}
{% tab title="LBLEAdvertisementData()" %}
Creates an **LBLEAdvertisementData** instance.

**Syntax**

**Parameters**

none

**Returns**

none
{% endtab %}
{% endtabs %}

### Methods <a href="#lbleadvertisementdata-methods" id="lbleadvertisementdata-methods"></a>

&#x20;configAsConnectableDevice()

configAsEddystoneURL()

&#x20;configAsIBeacon()

{% tabs %}
{% tab title="configAsConnectableDevice()" %}
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
{% endtab %}

{% tab title="configAsEddystoneURL()" %}
Configure an Eddystone URL Note that total length must not exceed 17 bytes.

**Syntax**

*advData.*&#x63;onfigAsEddystoneURL(prefix, url, suffix, tail);

**Parameters**

You can use prefix, suffix, and tail parameters to compress common URL parts to a single byte. e.g. "[https://www.mediatek.com](https://www.mediatek.com/)" => configAsEddystoneURL(EDDY\_HTTPS\_WWW, "mediatek", EDDY\_DOT\_COM) e.g. "<https://www.asp.net/learn>" => configAsEddystoneURL(EDDY\_HTTPS\_WWW, "asp", EDDY\_DOT\_NET\_SLASH, "learn")

Please refer to <https://github.com/google/eddystone/tree/master/eddystone-url#url-scheme-prefix> to know how the prefix/suffix/tails are expanded.

**Returns**

none
{% endtab %}

{% tab title="configAsIBeacon()" %}
Create an iBeacon advertisement.

This methods RESETS all the advertisement data fields and replace them with iBeacon format (flag + manufacturer data)

if you don't know which UUID to use, use [LBLEUuid](file:///D:/doxy_output/html/class_l_b_l_e_uuid.html)("74278BDA-B644-4520-8F0C-720EAF059935"), since this is the UUID used by iOS AirLocate example. (<https://developer.apple.com/library/content/samplecode/AirLocate/Introduction/Intro.html>)

major, minor, and txPower are all user defined values.

**Syntax**

**Parameters**

uuid: UUID of the iBeacon device. if you don't know which UUID to use, use [LBLEUuid](file:///D:/doxy_output/html/class_l_b_l_e_uuid.html)("74278BDA-B644-4520-8F0C-720EAF059935"), since this is the UUID used by iOS AirLocate example. (<https://developer.apple.com/library/content/samplecode/AirLocate/Introduction/Intro.html>)

major: user-defined values for the iBeacon

minor: user-defined values for the iBeacon

txPower: user-defined TxPower values for the iBeacon - usually a value that can be calibrated for central devices to estimate distance to the beacon.

Returns

none
{% endtab %}
{% endtabs %}
