Created
May 27, 2019 03:37
-
-
Save kitchen/b8b9744d2aec9c20cd4a894f082d8a3a to your computer and use it in GitHub Desktop.
step 2: scan for peripherals!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scanning for peripherals with the TNC service | |
found a peripheral: 9572E6EC-4A27-420E-BEFB-106B0F785839 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension TNC3Connector: CBCentralManagerDelegate { | |
func centralManagerDidUpdateState(_ central: CBCentralManager) { | |
print("CBCentralManager started") | |
print("scanning for peripherals with the TNC service") | |
let tnc3Service = CBUUID(string: "00000001-BA2A-46C9-AE49-01B0961F68BB") // the TNC service UUID | |
central.scanForPeripherals(withServices: [tnc3Service]) | |
} | |
func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) { | |
print("found a peripheral: \(peripheral.identifier)") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment