Skip to content

Commit 80ded19

Browse files
committed
Fix AndroidCentral.peripherals
1 parent 059fb68 commit 80ded19

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Sources/AndroidBluetooth/AndroidCentral.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ public final class AndroidCentral: CentralManager {
3737

3838
public var peripherals: [GATT.Peripheral : Bool] {
3939
get async {
40-
[:] // FIXME:
40+
await storage.update { state in
41+
var peripherals = [GATT.Peripheral: Bool]()
42+
peripherals.reserveCapacity(state.scan.peripherals.count)
43+
for peripheral in state.scan.peripherals.keys {
44+
peripherals[peripheral] = state.cache[peripheral] != nil
45+
}
46+
return peripherals
47+
}
4148
}
4249
}
4350

0 commit comments

Comments
 (0)