Skip to content

Commit ac9d04a

Browse files
robert-alfarome-no-dev
authored andcommitted
Add BLEDevice::stopAdvertising() helper method to compliment startAdvertising(). (espressif#3624)
1 parent 2195109 commit ac9d04a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

libraries/BLE/src/BLEDevice.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,12 @@ void BLEDevice::startAdvertising() {
578578
log_v("<< startAdvertising");
579579
} // startAdvertising
580580

581+
void BLEDevice::stopAdvertising() {
582+
log_v(">> stopAdvertising");
583+
getAdvertising()->stop();
584+
log_v("<< stopAdvertising");
585+
} // stopAdvertising
586+
581587
/* multi connect support */
582588
/* requires a little more work */
583589
std::map<uint16_t, conn_status_t> BLEDevice::getPeerDevices(bool _client) {

libraries/BLE/src/BLEDevice.h

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class BLEDevice {
5050
/* move advertising to BLEDevice for saving ram and flash in beacons */
5151
static BLEAdvertising* getAdvertising();
5252
static void startAdvertising();
53+
static void stopAdvertising();
5354
static uint16_t m_appId;
5455
/* multi connect */
5556
static std::map<uint16_t, conn_status_t> getPeerDevices(bool client);

0 commit comments

Comments
 (0)