Exemplo n.º 1
0
 public RtuController(ModuleConfig config, ILogger logger = null)
 {
     this.channel = ModuleTcpChannel.CreateSingleton(config, logger);
     if (!this.channel.IsConnected)
     {
         this.channel.OpenAsync().GetAwaiter();
     }
     this.logger = logger;
 }
Exemplo n.º 2
0
 public ModuleService(ModuleConfig config, ModuleTcpChannel channel, Logger logger = null)
 {
     this.config = config;
     output      = channel;
     this.logger = logger;
     mapper      = new MbapMapper(Guid.NewGuid().ToString());
     adapter     = new ModuleTwinAdapter();
     adapter.OnConfigurationReceived += Adapter_OnConfigurationReceived;
 }
Exemplo n.º 3
0
        public RtuController(ModuleConfig config, ModuleTcpChannel channel, ILogger logger = null)
        {
            if (channel == null)
            {
                this.channel = ModuleTcpChannel.CreateSingleton(config, logger);
                if (!this.channel.IsConnected)
                {
                    this.channel.OpenAsync().GetAwaiter();
                }
            }
            else
            {
                this.channel = channel;
            }

            this.logger = logger;
            mapper      = new MbapMapper(Guid.NewGuid().ToString());
        }