|
|
@@ -24,6 +24,11 @@ namespace BPASmartClient.Business |
|
|
|
|
|
|
|
ScreenDeviceType LocDeviceType; |
|
|
|
|
|
|
|
string MQTT_IP; |
|
|
|
string MQTT_PORT; |
|
|
|
string MQTT_USERNAME; |
|
|
|
string MQTT_PASSWORD; |
|
|
|
|
|
|
|
public void Init(ScreenDeviceType DeviceType) |
|
|
|
{ |
|
|
|
MqttPushs.Name = DeviceType; |
|
|
@@ -32,8 +37,13 @@ namespace BPASmartClient.Business |
|
|
|
{ |
|
|
|
mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(DeviceType)) ; |
|
|
|
|
|
|
|
}); |
|
|
|
mQTTProxy.Connect("emqx_u_block", "emqx_p_admin3658765490789", "47.108.65.220", 1883, $"{DeviceType}_设备监听数据{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");//"10.2.1.254""admin", "public" |
|
|
|
}); |
|
|
|
MQTT_IP = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_IP"].ToString(); |
|
|
|
MQTT_PORT = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_Port"].ToString(); |
|
|
|
MQTT_USERNAME = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_User"].ToString(); |
|
|
|
MQTT_PASSWORD = System.Configuration.ConfigurationManager.AppSettings["MQTT_DevieScreem_Password"].ToString(); |
|
|
|
|
|
|
|
mQTTProxy.Connect(MQTT_USERNAME, MQTT_PASSWORD, MQTT_IP, int.Parse(MQTT_PORT), $"{DeviceType}_设备监听数据{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");//"10.2.1.254""admin", "public" |
|
|
|
} |
|
|
|
|
|
|
|
public void Start() |
|
|
|