Skip to content

Instantly share code, notes, and snippets.

@ryanjjones10
Created June 29, 2016 23:35
Show Gist options
  • Save ryanjjones10/9f27b0741b6422616caad84003b3e5db to your computer and use it in GitHub Desktop.
Save ryanjjones10/9f27b0741b6422616caad84003b3e5db to your computer and use it in GitHub Desktop.
func centralManager(central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber) {
if (peripheral.name != nil && peripheral.name! == "Device Name"){
self.peripheral = peripheral
self.centralManager.connectPeripheral(self.peripheral, options: [CBConnectPeripheralOptionNotifyOnDisconnectionKey : true])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment