Skip to content

Commit 81f1476

Browse files
committed
Merge pull request #20 from loudnate/filter-services
Filter the services array to just the CGM service
2 parents efc8f2b + 8f5a14c commit 81f1476

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xDripG5/BluetoothManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
364364
// MARK: - CBPeripheralDelegate
365365

366366
func peripheral(peripheral: CBPeripheral, didDiscoverServices error: NSError?) {
367-
for service in peripheral.services ?? [] {
367+
for service in peripheral.services ?? [] where service.UUID.UUIDString == TransmitterServiceUUID.CGMService.rawValue {
368368
var characteristicsToDiscover = [CBUUID]()
369369
let knownCharacteristics = service.characteristics?.flatMap({ $0.UUID }) ?? []
370370

0 commit comments

Comments
 (0)