Inheritance: BaseSphero, IConnectedSphero
Ejemplo n.º 1
0
 private void DoConnect(Action<IConnectedSphero> onSuccess, Action<Exception> onError)
 {
     try
     {
         var socket = BluetoothDevice.CreateRfcommSocketToServiceRecord(SppUuid);
         socket.Connect();
         var connected = new ConnectedSphero(BluetoothDevice, socket);
         onSuccess(connected);
     }
     catch (Exception exception)
     {
         onError(exception);
     }
 }
Ejemplo n.º 2
0
 private void DoConnect(Action <IConnectedSphero> onSuccess, Action <Exception> onError)
 {
     try
     {
         var socket = BluetoothDevice.CreateRfcommSocketToServiceRecord(SppUuid);
         socket.Connect();
         var connected = new ConnectedSphero(BluetoothDevice, socket);
         onSuccess(connected);
     }
     catch (Exception exception)
     {
         onError(exception);
     }
 }