Пример #1
0
        public void Shutdown()
        {
            StopScanning();

            if (_service != null)
            {
                _service.Dispose();
                _service = null;
            }

            if (_peripheral != null)
            {
                _peripheral.Dispose();
                _peripheral = null;
            }

            if (_centralManager != null)
            {
                _centralManager.Dispose();
                _centralManager = null;
            }

            if (_dispatchQueue != null)
            {
                _dispatchQueue.Dispose();
                _dispatchQueue = null;
            }
        }
Пример #2
0
 public void Disconnect()
 {
     Adapter.Current.DisconnectDevice(this);
     _nativeDevice.Dispose();
 }
Пример #3
0
 /// <summary>
 /// Discconnect from the device.
 /// </summary>
 public void Disconnect()
 {
     Adapter.Current.DisconnectDevice(this);
     _peripheral.Dispose();
 }