This commit is contained in:
2018-09-06 20:26:38 +00:00
parent dd6f8a7e6a
commit a7c0a8906a
7 changed files with 12 additions and 2 deletions
+10 -1
View File
@@ -25,7 +25,16 @@ namespace BlubbFish.Utils.IoT.Connector.Data {
} else {
this.client.Connect(Guid.NewGuid().ToString());
}
this.client.Subscribe(new String[] { "#" }, new Byte[] { MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE });
if (this.settings.ContainsKey("topic")) {
Int32 l = this.settings["topic"].Split(';').Length;
Byte[] qos = new Byte[l];
for (Int32 i = 0; i < qos.Length; i++) {
qos[i] = MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE;
}
this.client.Subscribe(this.settings["topic"].Split(';'), qos);
} else {
this.client.Subscribe(new String[] { "#" }, new Byte[] { MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE });
}
}
private void Client_MqttMsgPublishReceived(Object sender, MqttMsgPublishEventArgs e) {
Binary file not shown.
Binary file not shown.