18#ifndef NIMBLE_CPP_ADVERTISEMENT_DATA_H_
19#define NIMBLE_CPP_ADVERTISEMENT_DATA_H_
22#if (defined(CONFIG_BT_ENABLED) && defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER) && !CONFIG_BT_NIMBLE_EXT_ADV) || \
38 bool addData(
const uint8_t* data,
size_t length);
39 bool addData(
const std::vector<uint8_t>& data);
52 bool setURI(
const std::string& uri);
53 bool setName(
const std::string& name,
bool isComplete =
true);
74 bool setServices(
bool complete, uint8_t size,
const std::vector<NimBLEUUID>& v_uuid);
75 std::vector<uint8_t> m_payload{};
Advertisement data set by the programmer to be published by the BLE server.
Definition NimBLEAdvertisementData.h:33
bool setFlags(uint8_t)
Set the advertisement flags.
Definition NimBLEAdvertisementData.cpp:86
bool setServiceData(const NimBLEUUID &uuid, const uint8_t *data, size_t length)
Set the service data advertised for the UUID.
Definition NimBLEAdvertisementData.cpp:458
bool setPartialServices(const NimBLEUUID &uuid)
Set a single service to advertise as a partial list of services.
Definition NimBLEAdvertisementData.cpp:381
bool setManufacturerData(const uint8_t *data, size_t length)
Set manufacturer specific data.
Definition NimBLEAdvertisementData.cpp:268
std::vector< uint8_t > getPayload() const
Retrieve the payload that is to be advertised.
Definition NimBLEAdvertisementData.cpp:554
bool setShortName(const std::string &name)
Set the short name.
Definition NimBLEAdvertisementData.cpp:345
bool addTxPower()
Adds Tx power level to the advertisement data.
Definition NimBLEAdvertisementData.cpp:108
int getDataLocation(uint8_t type) const
Get the location of the data in the payload.
Definition NimBLEAdvertisementData.cpp:521
bool setAppearance(uint16_t appearance)
Set the appearance.
Definition NimBLEAdvertisementData.cpp:65
bool addData(const uint8_t *data, size_t length)
Add data to the payload to be advertised.
Definition NimBLEAdvertisementData.cpp:41
std::string toString() const
Get the string representation of the advertisement data.
Definition NimBLEAdvertisementData.cpp:569
bool setPartialServices32(const std::vector< NimBLEUUID > &uuids)
Set the partial list of services to advertise.
Definition NimBLEAdvertisementData.cpp:399
bool setURI(const std::string &uri)
Set the URI to advertise.
Definition NimBLEAdvertisementData.cpp:304
bool setCompleteServices16(const std::vector< NimBLEUUID > &uuids)
Set the complete list of 16 bit services to advertise.
Definition NimBLEAdvertisementData.cpp:363
bool setPartialServices16(const std::vector< NimBLEUUID > &uuids)
Set the partial list of services to advertise.
Definition NimBLEAdvertisementData.cpp:390
bool setCompleteServices(const NimBLEUUID &uuid)
Set a single service to advertise as a complete list of services.
Definition NimBLEAdvertisementData.cpp:354
void clearData()
Clear the advertisement data for reuse.
Definition NimBLEAdvertisementData.cpp:561
bool addServiceUUID(const NimBLEUUID &serviceUUID)
Add a service uuid to exposed list of services.
Definition NimBLEAdvertisementData.cpp:148
bool setPreferredParams(uint16_t minInterval, uint16_t maxInterval)
Set the preferred min and max connection intervals to advertise.
Definition NimBLEAdvertisementData.cpp:127
bool removeData(uint8_t type)
Remove data from the advertisement data.
Definition NimBLEAdvertisementData.cpp:537
bool removeServiceUUID(const NimBLEUUID &serviceUUID)
Remove a service UUID from the advertisement.
Definition NimBLEAdvertisementData.cpp:203
bool setName(const std::string &name, bool isComplete=true)
Set the complete name of this device.
Definition NimBLEAdvertisementData.cpp:326
bool setCompleteServices32(const std::vector< NimBLEUUID > &uuids)
Set the complete list of 32 bit services to advertise.
Definition NimBLEAdvertisementData.cpp:372
bool removeServices()
Remove all service UUIDs from the advertisement.
Definition NimBLEAdvertisementData.cpp:258
Perform and manage BLE advertising.
Definition NimBLEAdvertising.h:52
A model of a BLE UUID.
Definition NimBLEUUID.h:41