Skip to content

Commit

Permalink
Merge pull request #263 from NordicSemiconductor/connected-peripherals
Browse files Browse the repository at this point in the history
Change: Retrieve Connected Peripherals advertising SMP Service on Scan Start
  • Loading branch information
dinesharjani authored Oct 9, 2024
2 parents af73322 + 57d4258 commit c8ab852
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class ScannerViewController: UITableViewController, CBCentralManagerDelegate, UI

if centralManager.state == .poweredOn {
activityIndicator.startAnimating()

let connectedPeripherals = centralManager.retrieveConnectedPeripherals(withServices: [McuMgrBleTransportConstant.SMP_SERVICE])
for peripheral in connectedPeripherals {
centralManager(centralManager, didDiscover: peripheral, advertisementData: [:], rssi: -127)
}
centralManager.scanForPeripherals(withServices: nil, options: [CBCentralManagerScanOptionAllowDuplicatesKey : true])
}
}
Expand Down

0 comments on commit c8ab852

Please sign in to comment.