mqtt单例测试
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using JY.Model.Excel;
|
||||
using JY.Inspection.Common;
|
||||
using JY.Model.Excel;
|
||||
using JY.Utility;
|
||||
using MetroFramework.Forms;
|
||||
using System;
|
||||
@@ -50,5 +51,19 @@ namespace JY.Inspection.Frm
|
||||
MessageBox.Show(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private async void btn_sendMQTTClient_Click(object sender, EventArgs e)
|
||||
{
|
||||
await MqttSingleton.Instance.InitializeAsync(
|
||||
brokerHost: "127.0.0.1",
|
||||
clientId: "EVE",
|
||||
username: string.Empty,
|
||||
password: string.Empty
|
||||
);
|
||||
|
||||
string topic = "EVE/工厂编码/EQP/设备编码";
|
||||
string payload = "测试数据";
|
||||
await MqttSingleton.Instance.SendAsync(topic, payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user