diff --git a/BPASmartClient.Business/Plugin/LocalMqtt.cs b/BPASmartClient.Business/Plugin/LocalMqtt.cs index 170c5fde..c8a22c3a 100644 --- a/BPASmartClient.Business/Plugin/LocalMqtt.cs +++ b/BPASmartClient.Business/Plugin/LocalMqtt.cs @@ -15,13 +15,18 @@ namespace BPASmartClient.Business.Plugin public static LocalMqtt GetInstance => _Instance ?? (_Instance = new LocalMqtt()); private LocalMqtt() { } - SendScreenDataModel MqttPush = new SendScreenDataModel(); + /// + /// + /// + SendScreenDataModel MqttPushs = new SendScreenDataModel(); + + MQTTProxy mQTTProxy = new MQTTProxy(); public void Init(ScreenDeviceType DeviceType) { Dictionary MqttPushdata = new Dictionary(); - MqttPush.mqttDataDic.Add(DeviceType.ToString(), SetTopic(DeviceType, MqttPushdata)); - MQTTProxy mQTTProxy = new MQTTProxy(); + MqttPushs.mqttDataDic.Add(DeviceType.ToString(), SetTopic(DeviceType, MqttPushdata)); + mQTTProxy.Connected = new Action(() => { mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(DeviceType)) ;