public void Disconnect() { if (_gatt != null) { _gatt.Disconnect(); _gatt.Dispose(); } }
private void CloseGATT() { if (_gatt != null) { _gatt.Close(); _gatt.Dispose(); _gatt = null; } }
public void Dispose() { try { StopUpdates(); _nativeCharacteristic.Dispose(); _gatt.Dispose(); } catch { } }
public void Disconnect() { lock (_lock) { if (_bluetoothGatt != null) { _bluetoothGatt.Disconnect(); _bluetoothGatt.Close(); _bluetoothGatt.Dispose(); _bluetoothGatt = null; _bluetoothDevice.Dispose(); _bluetoothDevice = null; } State = BluetoothLEDeviceState.Disconnected; } }
public void Disconnect() { lock (_lock) { _onDeviceDisconnected = null; _onCharacteristicChanged = null; if (_bluetoothGatt != null) { _bluetoothGatt.Disconnect(); _bluetoothGatt.Close(); _bluetoothGatt.Dispose(); _bluetoothGatt = null; _bluetoothDevice.Dispose(); _bluetoothDevice = null; } State = BluetoothLEDeviceState.Disconnected; } }
public void EnumServices(Context ctx, string identifer) { BluetoothDevice device = mapDevices[identifer]; if (device != null) { GattDevice gattdevice = new GattDevice(ctx, identifer); if (gatt != null) { //gatt.Disconnect(); gatt.Close(); //or gatt.Connect() to re-connect to device gatt.Dispose(); } gatt = device.ConnectGatt(ctx, false, gattdevice); //-> OnConnectionStateChange() -> DiscoverServices() -> OnServicesDiscovered() -> GattDevice.Initialize() if (gatt == null) { Log.Error(TAG, string.Format("failed to connect to GATT server '{0}'", identifer)); } } }
internal void Disconnect() { gatt.Disconnect(); gatt.Close(); gatt.Dispose(); }
public void Disconnect() { gatt?.Disconnect(); gatt?.Dispose(); }