예제 #1
0
        public void Initialize(Dictionary <string, object> settings)
        {
            string[] fieldNames = new string[] { "IotHubConfigFile", "TagStateManager", "TagToIotHubMessageConverter" };
            FieldValidator.CheckMissingFields(settings, fieldNames);
            string iotHubConfigFile = settings.GetValueOrNull("IotHubConfigFile") as string;

            _iotHubConfig    = ConfigUtility.ReadConfig <IotHubConfig>(iotHubConfigFile);
            _dataConverter   = settings.GetValueOrNull("TagToIotHubMessageConverter") as IConverter <Tag, object>;
            _tagStateManager = settings.GetValueOrNull("TagStateManager") as TagStateManager;
            _deviceClienPool = new DeviceClientPool();
            _deviceClienPool.Initialize(_iotHubConfig.IotHubHostName, _iotHubConfig.TelemetryDevicePool);
        }
예제 #2
0
        public void Initialize(Dictionary <string, object> settings)
        {
            string[] fieldNames = new string[] { "IotHubConfigFile", "MessageConverter.OpcUa", "MessageExchange.Messaging", "MessageConverter.IotHub", "Logger" };
            FieldValidator.CheckMissingFields(settings, fieldNames);
            string iotHubConfigFile = settings.GetValueOrNull("IotHubConfigFile") as string;

            _iotHubConfig          = ConfigUtility.ReadConfig <IotHubConfig>(iotHubConfigFile);
            _toIotHubDataConverter = settings.GetValueOrNull("MessageConverter.IotHub") as IConverter <TExchangeMsg, object>;
            _alarmMessageExchange  = settings.GetValueOrNull("MessageExchange.Messaging") as IMessageExchange <TExchangeMsg>;
            _logger          = settings.GetValueOrNull("Logger") as ILogger;
            _deviceClienPool = new DeviceClientPool();
            _deviceClienPool.Initialize(_iotHubConfig.IotHubHostName, _iotHubConfig.AlarmDevicePool);
        }
예제 #3
0
        public void Initialize(Dictionary <string, object> settings)
        {
            //ConfigureSettings(settings);
            string[] fieldNames = new string[] { "IotHubConfigFile", "Logger", "CmdExecutor", "CmdConverter" };
            FieldValidator.CheckMissingFields(settings, fieldNames);

            string iotHubConfigFile = settings.GetValueOrNull("IotHubConfigFile") as string;

            _iotHubConfig = ConfigUtility.ReadConfig <IotHubConfig>(iotHubConfigFile);
            _cmdConverter = settings.GetValueOrNull("CmdConverter") as IConverter <string, TCmd>;
            _cmdExecutor  = settings.GetValueOrNull("CmdExecutor") as ICommandExecutor <TCmd>;
            _logger       = settings.GetValueOrNull("Logger") as ILogger;

            _deviceClientPool = new DeviceClientPool();
            _deviceClientPool.Initialize(_iotHubConfig.IotHubHostName, _iotHubConfig.CommandDevicePool);
        }