Skip to content

Instantly share code, notes, and snippets.

@ryanjjones10
Created June 30, 2016 00:54
Show Gist options
  • Save ryanjjones10/4be21b76b70cbb68d9539c810e49333a to your computer and use it in GitHub Desktop.
Save ryanjjones10/4be21b76b70cbb68d9539c810e49333a to your computer and use it in GitHub Desktop.
func centralManager(central: CBCentralManager, didConnectPeripheral peripheral: CBPeripheral) {
peripheral.delegate = self
peripheral.discoverServices(nil)
print("connected to \(peripheral)")
self.stopScan()
}
func centralManager(central: CBCentralManager, didFailToConnectPeripheral peripheral: CBPeripheral, error: NSError?){
print("connection failed", error)
}
func stopScan(){
self.centralManager.stopScan()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment