public void ConnectToDevice(IDevice device) { //TODO: if it doesn't connect after 10 seconds, cancel the operation // (follow the same model we do for scanning). CentralManager.ConnectPeripheral(device.NativeDevice as CBPeripheral, new PeripheralConnectionOptions()); /* * // in 10 seconds, stop the connection * await Task.Delay(10000); * * // if we're still trying to connect * if (IsConnecting) * { * Console.WriteLine("Adapter: Connect timeout has elapsed."); * Central. ... * ConnectTimeoutElapsed(this, new EventArgs()); * } */ }