Example #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));
        }
Example #2
0
        public OutpostDeviceService(
            IDeviceRegistryService deviceRegistryService,
            IDeviceMessageBrokerService deviceMessageBroker,
            II2CBusService i2CBusService,
            ISchedulerService schedulerService,
            ILogService logService)
        {
            if (deviceRegistryService == null)
            {
                throw new ArgumentNullException(nameof(deviceRegistryService));
            }
            _i2CBusService       = i2CBusService ?? throw new ArgumentNullException(nameof(i2CBusService));
            _schedulerService    = schedulerService ?? throw new ArgumentNullException(nameof(schedulerService));
            _deviceMessageBroker = deviceMessageBroker ?? throw new ArgumentNullException(nameof(deviceMessageBroker));
            _logService          = logService ?? throw new ArgumentNullException(nameof(logService));

            deviceRegistryService.RegisterDeviceFactory(new OutpostDeviceFactory(this));
        }