mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-11-22 05:00:55 +01:00
Add clearData method to NimBLEAdvertisementData.
This commit is contained in:
parent
20349c64a4
commit
bc7bfe8278
2 changed files with 9 additions and 0 deletions
|
@ -1064,4 +1064,12 @@ std::string NimBLEAdvertisementData::getPayload() {
|
||||||
return m_payload;
|
return m_payload;
|
||||||
} // getPayload
|
} // getPayload
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear the advertisement data for reuse.
|
||||||
|
*/
|
||||||
|
void NimBLEAdvertisementData::clearData() {
|
||||||
|
m_payload.clear();
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_BROADCASTER && !CONFIG_BT_NIMBLE_EXT_ADV */
|
#endif /* CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_BROADCASTER && !CONFIG_BT_NIMBLE_EXT_ADV */
|
||||||
|
|
|
@ -76,6 +76,7 @@ public:
|
||||||
void addTxPower();
|
void addTxPower();
|
||||||
void setPreferredParams(uint16_t min, uint16_t max);
|
void setPreferredParams(uint16_t min, uint16_t max);
|
||||||
std::string getPayload(); // Retrieve the current advert payload.
|
std::string getPayload(); // Retrieve the current advert payload.
|
||||||
|
void clearData(); // Clear the advertisement data.
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class NimBLEAdvertising;
|
friend class NimBLEAdvertising;
|
||||||
|
|
Loading…
Reference in a new issue