19#ifndef MBED_GAP_ADVERTISING_DATA_H__
20#define MBED_GAP_ADVERTISING_DATA_H__
25#include "platform/NonCopyable.h"
28#include "ble/common/BLETypes.h"
29#include "ble/common/blecommon.h"
30#include "ble/gap/AdvertisingDataTypes.h"
31#include "ble/gap/Types.h"
437 uint8_t _payload_length;
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.
AdvertisingDataBuilder(uint8_t *buffer, size_t buffer_size)
Advertising data needs a user provided buffer to store the data.
ble_error_t setAdvertisingInterval(adv_interval_t interval)
Add advertising interval to the payload.
ble_error_t getData(mbed::Span< const uint8_t > &data, adv_data_type_t advDataType)
Return a span of data containing the the type of data requested.
ble_error_t addOrReplaceData(adv_data_type_t advDataType, mbed::Span< const uint8_t > fieldData)
Adds a new field into the payload.
ble_error_t replaceData(adv_data_type_t advDataType, mbed::Span< const uint8_t > fieldData)
Replace a new field into 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 removeData(adv_data_type_t advDataType)
Remove existing date of given type.
AdvertisingDataBuilder(mbed::Span< uint8_t > buffer)
Advertising data needs a user-provided buffer to store the data.
ble_error_t appendData(adv_data_type_t advDataType, mbed::Span< const uint8_t > fieldData)
Append data to an existing field in the 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 addOrAppendData(adv_data_type_t advDataType, mbed::Span< const uint8_t > fieldData)
Adds a new field into the payload.
ble_error_t setRequestedServiceList(mbed::Span< const UUID > data)
Add a list of UUIDs of solicited services.
void clear()
Clears the advertising data payload.
ble_error_t setLocalServiceList(mbed::Span< const UUID > data, bool complete=true)
Add local service IDs to the advertising payload.
ble_error_t
Error codes for the BLE API.
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.