Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/NimBLEAdvertising.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,22 @@ void NimBLEAdvertising::clearData() {
m_advDataSet = false;
} // clearData

/**
* @brief Refresh advertsing data dynamically without stop/start cycle.
* For instance allows refreshing manufacturer data dynamically.
*
* @return True if the data was set successfully.
* @details If scan response is enabled it will be refreshed as well.
*/
bool NimBLEAdvertising::refreshAdvertisingData() {
bool success = setAdvertisementData(m_advData);
if (m_scanResp) {
success = setScanResponseData(m_scanData);
}

return success;
} // refreshAdvertisingData

/**
* @brief Add a service uuid to exposed list of services.
* @param [in] serviceUUID The UUID of the service to expose.
Expand Down
1 change: 1 addition & 0 deletions src/NimBLEAdvertising.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class NimBLEAdvertising {
const NimBLEAdvertisementData& getAdvertisementData();
const NimBLEAdvertisementData& getScanData();
void clearData();
bool refreshAdvertisingData();

bool addServiceUUID(const NimBLEUUID& serviceUUID);
bool addServiceUUID(const char* serviceUUID);
Expand Down