Skip to content

Commit

Permalink
Change value returned in ScanDiscovery from retrieveConnectedPeripher…
Browse files Browse the repository at this point in the history
…als with services
  • Loading branch information
rickytribbia committed Jan 16, 2020
1 parent 0c52674 commit fa605c9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Bluejay/Bluejay/Bluejay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -568,15 +568,14 @@ public class Bluejay: NSObject { //swiftlint:disable:this type_body_length
- Parameter services: array of services that already system bluetooth connected peripherals has to have
- Returns: already system bluetooth connected peripherals with requested services
*/
public func retrieveConnectedPeripherals(with services: [CBUUID]) -> [PeripheralIdentifier] {
public func retrieveConnectedPeripherals(with services: [CBUUID]) -> [ScanDiscovery] {
if let centralManager = cbCentralManager {
let cbPeripherals = centralManager.retrieveConnectedPeripherals(withServices: services)

let peripherals: [PeripheralIdentifier] = cbPeripherals.map { cbPeripheral -> PeripheralIdentifier in
return PeripheralIdentifier(uuid: cbPeripheral.identifier, name: cbPeripheral.name)
let scanDiscoveries: [ScanDiscovery] = cbPeripherals.map { cbPeripheral -> PeripheralIdentifier in
let peripheralIdentifier PeripheralIdentifier(uuid: cbPeripheral.identifier, name: cbPeripheral.name)
return ScanDiscovery(peripheralIdentifier: peripheralIdentifier, advertisementPacket: [:], rssi: 0)
}

return peripherals
return scanDiscoveries
}
return []
}
Expand Down

0 comments on commit fa605c9

Please sign in to comment.