Skip to content

Commit 1785ffc

Browse files
sgbihuyashaswini-hanji
authored andcommitted
Fix Jira 864 After BLE.end() a peripheral is still showing up in scans
1. Stop scan, advertising and disconnect the connected devices when call end Changed files BLEDeviceManager.cpp - do the real action BLEDevice.cpp - only local BLE device call the real end
1 parent 562cd84 commit 1785ffc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

libraries/CurieBLE/src/BLEDevice.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ void BLEDevice::poll()
8585
}
8686

8787
void BLEDevice::end()
88-
{}
88+
{
89+
if (BLEUtils::isLocalBLE(*this))
90+
{
91+
BLEDeviceManager::instance()->end();
92+
}
93+
}
8994

9095
bool BLEDevice::connected() const
9196
{

libraries/CurieBLE/src/internal/BLEDeviceManager.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ void BLEDeviceManager::poll()
167167

168168
void BLEDeviceManager::end()
169169
{
170+
stopScanning();
171+
stopAdvertising();
172+
// Disconnect the connections
173+
disconnect(&BLE);
170174
}
171175

172176
bool BLEDeviceManager::connected(const BLEDevice *device) const

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy