19#ifndef BLE_GAP_SIMPLEADVERTISINGDATABUILDER_H
20#define BLE_GAP_SIMPLEADVERTISINGDATABUILDER_H
22#include "platform/Span.h"
25#include "ble/gap/AdvertisingDataBuilder.h"
65template<
size_t DataSize>
318 uint8_t _buffer[DataSize];
Representation of a Universally Unique Identifier (UUID).
ble_error_t addData(adv_data_type_t advDataType, mbed::Span< const uint8_t > fieldData)
Add a new field into the payload.
ble_error_t setManufacturerSpecificData(mbed::Span< const uint8_t > data)
Add manufacturer-specific data to the advertising payload.
ble_error_t setConnectionIntervalPreference(conn_interval_t min, conn_interval_t max)
Add connection interval preferences to the payload.
ble_error_t setTxPowerAdvertised(advertising_power_t txPower)
Add the advertising TX in the advertising payload.
ble_error_t setFlags(adv_data_flags_t flags=adv_data_flags_t::default_flags)
Add BLE flags in the advertising payload.
ble_error_t setAdvertisingInterval(adv_interval_t interval)
Add advertising interval to the payload.
ble_error_t setServiceData(UUID service, mbed::Span< const uint8_t > data)
Add service data data to the advertising payload.
ble_error_t setAppearance(adv_data_appearance_t appearance)
Add device appearance in the advertising payload.
mbed::Span< const uint8_t > getAdvertisingData() const
Get the subspan of the buffer containing valid data.
ble_error_t setName(const char *name, bool complete=true)
Add device name to the advertising payload.
ble_error_t setRequestedServiceList(mbed::Span< const UUID > data)
Add a list of UUIDs of solicited services.
ble_error_t setLocalServiceList(mbed::Span< const UUID > data, bool complete=true)
Add local service IDs to the advertising payload.
AdvertisingDataSimpleBuilder & setRequestedService(const UUID &data)
Add a UUID of a solicited service.
AdvertisingDataSimpleBuilder & setManufacturerSpecificData(mbed::Span< const uint8_t > data)
Add manufacturer specific data to the advertising payload.
AdvertisingDataSimpleBuilder & setAppearance(adv_data_appearance_t appearance)
Add device appearance in the advertising payload.
AdvertisingDataSimpleBuilder & setLocalServiceList(mbed::Span< const UUID > data, bool complete=true)
Add local service IDs to the advertising payload.
AdvertisingDataSimpleBuilder()
Construct a AdvertisingDataSimpleBuilder.
AdvertisingDataSimpleBuilder & setConnectionIntervalPreference(conn_interval_t min, conn_interval_t max)
Add connection interval preferences to the payload.
AdvertisingDataSimpleBuilder & setTxPowerAdvertised(advertising_power_t txPower)
Add the advertising TX in the advertising payload.
AdvertisingDataSimpleBuilder & setFlags(adv_data_flags_t flags=adv_data_flags_t::default_flags)
Add BLE flags in the advertising payload.
AdvertisingDataSimpleBuilder & setName(const char *name, bool complete=true)
Add device name to the advertising payload.
AdvertisingDataSimpleBuilder & setServiceData(const UUID &service, mbed::Span< const uint8_t > data)
Add service data to the advertising payload.
AdvertisingDataSimpleBuilder & setRequestedServiceList(mbed::Span< const UUID > data)
Add a list of UUIDs of solicited services.
mbed::Span< const uint8_t > getAdvertisingData() const
Get the subspan of the buffer containing valid data.
AdvertisingDataSimpleBuilder & setAdvertisingInterval(adv_interval_t interval)
Add advertising interval to the payload.
AdvertisingDataSimpleBuilder & setLocalService(const UUID &data, bool complete=true)
Add local service ID to the advertising payload.
AdvertisingDataSimpleBuilder & addData(adv_data_type_t advDataType, mbed::Span< const uint8_t > fieldData)
Add a new field into the payload.
ble_error_t
Error codes for the BLE API.
@ BLE_ERROR_NONE
No error.
Entry namespace for all BLE API definitions.
Enumeration of values for the adv_data_type_t::APPEARANCE.
Set of advertising flags.
Nonowning view to a sequence of contiguous elements.