From 8f5a14c2ca3a0ffbd0d2718819023cb851a1135c Mon Sep 17 00:00:00 2001 From: Nathan Racklyeft Date: Sat, 12 Mar 2016 20:03:44 -0800 Subject: [PATCH] Filter the services array to just the CGM service --- xDripG5/BluetoothManager.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xDripG5/BluetoothManager.swift b/xDripG5/BluetoothManager.swift index d47b47d1..be95bb00 100644 --- a/xDripG5/BluetoothManager.swift +++ b/xDripG5/BluetoothManager.swift @@ -364,7 +364,7 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate // MARK: - CBPeripheralDelegate func peripheral(peripheral: CBPeripheral, didDiscoverServices error: NSError?) { - for service in peripheral.services ?? [] { + for service in peripheral.services ?? [] where service.UUID.UUIDString == TransmitterServiceUUID.CGMService.rawValue { var characteristicsToDiscover = [CBUUID]() let knownCharacteristics = service.characteristics?.flatMap({ $0.UUID }) ?? []