예제 #1
0
        private void ExecutionFailed(DeskCommands deskCommand)
        {
            var message = $"Failed for '{deskCommand}' command. " +
                          Constants.CheckAndEnableBluetooth;

            _logger.Error(message);

            _errorManager.PublishForMessage(Constants.CheckAndEnableBluetooth);
        }
예제 #2
0
        private async Task <bool> Execute(DeskCommands deskCommand)
        {
            if (!_provider.TryGetValue(deskCommand,
                                       out var bytes))
            {
                _logger.Error($"Failed for unknown command '{deskCommand}'");

                return(false);
            }

            var result = await _control.TryWriteRawControl2(bytes);

            if (!result)
            {
                ExecutionFailed(deskCommand);     // to do testing
            }
            return(result);
        }
 public bool TryGetValue(DeskCommands command,
                         out IEnumerable <byte> bytes)
 {
     return(_dictionary.TryGetValue(command,
                                    out bytes));
 }