Exemplo n.º 1
0
        public Boolean Start(DeviceConfiguration deviceConfig)
        {
            try
            {
                Log.Info("DeviceAdapter Starting...");
                var config = deviceConfig as DeviceConfigurationAdapter;
                if (config == null)
                {
                    throw new Exception("Init Device Adapter fails, please use DeviceConfigurationAdapter.");
                }

                Init(config);
                _deviceProxy.OpenConnection();
                _udpListener.Start();
                _webSocketClient.Start();
                _healthThread.Start();
                IsRunning = true;
                Log.Info("DeviceAdapter starts finished...");
                return(true);
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                return(false);
            }
        }