Example #1
0
        private ParameterControllerAdapter CreateParameterControllerAdapter()
        {
            var adapter = new ParameterControllerAdapter(_agent.Identity, Url, Channel);

            AddChild(adapter);

            return(adapter);
        }
Example #2
0
        protected virtual void OnDeviceRegistrationStateChanged(object sender, RegistrationEventArgs e)
        {
            var device = e.Device;

            if (e.State == RegistrationState.Registered)
            {
                ParameterControllerAdapter.ParametersUpdated -= OnParametersUpdated;
                ParameterControllerAdapter.ParametersUpdated += OnParametersUpdated;

                ParameterControllerAdapter.RegisterDevice(device);
            }
            else if (e.State == RegistrationState.Failed)
            {
                MsgLogger.WriteError($"{GetType().Name} - OnDeviceRegistrationStateChanged", $"Device ({device.Family}) registration failed!");
            }
        }