예제 #1
0
        protected override async Task DoExecuteAsync()
        {
            var device = _deviceController.ConnectedDevice;

            if (_deviceInfo != null && _deviceInfo.DeviceId != device.DeviceId)
            {
                throw new InvalidOperationException("Command executed on a wrong device");
            }

            if (device == null)
            {
                throw new InvalidOperationException("Device not connected");
            }

            var services = device.GattServices.ToList();

            Services = await _infoManager.GetAllServicesInfo(_deviceInfo, services).ConfigureAwait(false);
        }