组态使用mqtt推送
This commit is contained in:
parent
15c33ed8f1
commit
24c757087c
@ -120,7 +120,7 @@ namespace Plugin
|
|||||||
ret.CookedValue?.ToString())
|
ret.CookedValue?.ToString())
|
||||||
{
|
{
|
||||||
//这是设备变量列表要用的
|
//这是设备变量列表要用的
|
||||||
var msg = new InjectedMqttApplicationMessage(
|
var msgInternal = new InjectedMqttApplicationMessage(
|
||||||
new MqttApplicationMessage()
|
new MqttApplicationMessage()
|
||||||
{
|
{
|
||||||
Topic =
|
Topic =
|
||||||
@ -128,9 +128,9 @@ namespace Plugin
|
|||||||
Payload = Encoding.UTF8.GetBytes(
|
Payload = Encoding.UTF8.GetBytes(
|
||||||
JsonConvert.SerializeObject(ret))
|
JsonConvert.SerializeObject(ret))
|
||||||
});
|
});
|
||||||
mqttServer.InjectApplicationMessage(msg);
|
mqttServer.InjectApplicationMessage(msgInternal);
|
||||||
//这是在线组态要用的
|
//这是在线组态要用的
|
||||||
msg = new InjectedMqttApplicationMessage(
|
var msgConfigure = new InjectedMqttApplicationMessage(
|
||||||
new MqttApplicationMessage()
|
new MqttApplicationMessage()
|
||||||
{
|
{
|
||||||
Topic =
|
Topic =
|
||||||
@ -138,7 +138,7 @@ namespace Plugin
|
|||||||
Payload = Encoding.UTF8.GetBytes(
|
Payload = Encoding.UTF8.GetBytes(
|
||||||
JsonConvert.SerializeObject(ret.CookedValue))
|
JsonConvert.SerializeObject(ret.CookedValue))
|
||||||
});
|
});
|
||||||
mqttServer.InjectApplicationMessage(msg);
|
mqttServer.InjectApplicationMessage(msgConfigure);
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceValues[item.ID] = ret;
|
DeviceValues[item.ID] = ret;
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue
Block a user