Ejemplo n.º 1
0
        public CCToolsDeviceService(
            IDeviceRegistryService deviceRegistryService,
            II2CBusService i2CBusService,
            IInterruptMonitorService interruptMonitorService,
            IScriptingService scriptingService,
            ILogService log)
        {
            if (scriptingService == null)
            {
                throw new ArgumentNullException(nameof(scriptingService));
            }
            _deviceRegistryService = deviceRegistryService ?? throw new ArgumentNullException(nameof(deviceRegistryService));
            _i2CBusService         = i2CBusService ?? throw new ArgumentNullException(nameof(i2CBusService));
            _log = log?.CreatePublisher(nameof(CCToolsDeviceService)) ?? throw new ArgumentNullException(nameof(log));

            deviceRegistryService.RegisterDeviceFactory(new CCToolsDeviceFactory(this, interruptMonitorService));
        }
Ejemplo n.º 2
0
 public CCToolsDeviceFactory(CCToolsDeviceService ccToolsDeviceService, IInterruptMonitorService interruptMonitorService)
 {
     _interruptMonitorService = interruptMonitorService ?? throw new ArgumentNullException(nameof(interruptMonitorService));
     _ccToolsDeviceService    = ccToolsDeviceService ?? throw new ArgumentNullException(nameof(ccToolsDeviceService));
 }