public IRControlService(IIRSlingerCsharp irService, IACDeviceService acDeviceService, IHostDeviceService hostDeviceService) { _irService = irService; _currentAcDevice = acDeviceService.GetCurrentDevice(); _hostDevice = hostDeviceService.GetCurrentDevice(); }
public CodeRecordingService(IACDeviceService acDeviceService, IHostDeviceService hostDeviceService, ILogger <CodeRecordingService> logger) { _logger = logger; _currentAcDevice = acDeviceService.GetCurrentDevice(); var currentRaspberryPiDevice = hostDeviceService.GetCurrentDevice(); try { _inputPin = Pi.Gpio.Pins.Single(x => x.HeaderPinNumber == currentRaspberryPiDevice.BoardInPin); _inputPin.PinMode = GpioPinDriveMode.Input; } catch (Exception e) { _logger.LogError(e.Message); _logger.LogError(e.InnerException.InnerException.Message); } }