mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2025-07-30 02:17:13 +02:00
Add clearData method to NimBLEAdvertisementData.
This commit is contained in:
@ -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;
|
||||||
|
Reference in New Issue
Block a user