Esempio n. 1
0
        public void Configure()
        {
            _pythonScriptHostService.RegisterProxyObject("publish", new Action <PythonDictionary>(Publish));

            _mqttServerStorage.Configure();

            _mqttServer.ClientConnectedHandler         = _mqttClientConnectedHandler;
            _mqttServer.ClientDisconnectedHandler      = _mqttClientDisconnectedHandler;
            _mqttServer.ClientSubscribedTopicHandler   = _mqttClientSubscribedTopicHandler;
            _mqttServer.ClientUnsubscribedTopicHandler = _mqttClientUnsubscribedTopicHandler;

            _mqttServer.StartAsync(CreateMqttServerOptions()).GetAwaiter().GetResult();

            _logger.LogInformation("MQTT server started.");
        }
Esempio n. 2
0
 public void Configure()
 {
     _pythonScriptHostService.RegisterProxyObject("write_shared_data", new Action <string, object>(Write));
     _pythonScriptHostService.RegisterProxyObject("read_shared_data", new Func <string, object, object>(Read));
 }