/// <summary> /// Event handler to receive notice that the device has disconnected /// </summary> /// <param name="sender">Sender</param> /// <param name="e">Event args including the device info</param> private void _bleManager_DeviceDisconnectedEvent(object sender, DeviceEventArgs e) { DeviceInfo device = FindDeviceInfo(e.Device); Log(string.Format("Device {0} [{1}] disconnected", device != null ? device.Name : e.Device.Name, e.Device.Address)); if (device != null) { DeviceDisconnectEvent?.Invoke(this, new DeviceInfoEventArgs(device)); _localDisconnectionSuccess?.Invoke(this, new DeviceInfoEventArgs(device)); _localDisconnectionSuccess = null; } }
protected virtual void OnDeviceDisconnectEvent(BleGattDevice dev) { DeviceDisconnectEvent?.Invoke(dev); }
public virtual void OnDeviceDisconnectEvent(bool status) { DeviceDisconnectEvent?.Invoke(status); }