示例#1
0
        /// <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;
            }
        }
示例#2
0
 protected virtual void OnDeviceDisconnectEvent(BleGattDevice dev)
 {
     DeviceDisconnectEvent?.Invoke(dev);
 }
示例#3
0
 public virtual void OnDeviceDisconnectEvent(bool status)
 {
     DeviceDisconnectEvent?.Invoke(status);
 }