[NF] Filter topics if usefull

This commit is contained in:
BlubbFish 2017-12-05 23:22:33 +00:00
parent 6e077355da
commit f57af3c45a
5 changed files with 5 additions and 1 deletions

View File

@ -17,6 +17,7 @@ namespace BlubbFish.Utils.IoT.Connector.Data {
this.message = "";
this.p = new Process();
this.p.StartInfo.FileName = "mosquitto_sub";
String topic = "#";
String args = "-h " + this.settings["server"]+" ";
if(this.settings.ContainsKey("port")) {
args += "-p "+ this.settings["port"]+" ";
@ -30,7 +31,10 @@ namespace BlubbFish.Utils.IoT.Connector.Data {
if (this.settings.ContainsKey("key")) {
args += "--key " + this.settings["key"] + " ";
}
this.p.StartInfo.Arguments = args+"-t \"#\" -v -d";
if(this.settings.ContainsKey("topic")) {
topic = this.settings["topic"];
}
this.p.StartInfo.Arguments = args+"-t \""+ topic + "\" -v -d";
this.p.StartInfo.CreateNoWindow = true;
this.p.StartInfo.UseShellExecute = false;
this.p.StartInfo.RedirectStandardOutput = true;

Binary file not shown.

Binary file not shown.