public override void OnConnectionStateChange(BluetoothGatt gatt, GattStatus status, ProfileState newState) { base.OnConnectionStateChange(gatt, status, newState); switch (newState) { case ProfileState.Disconnected: parent.DeviceDisconnected(this, new DeviceConnectionEventArgs() { Device = gatt.Device }); break; case ProfileState.Connecting: break; case ProfileState.Connected: parent.connectedDevices.Add(gatt.Device, gatt); parent.DeviceConnected(this, new DeviceConnectionEventArgs() { Device = gatt.Device }); break; case ProfileState.Disconnecting: break; } }