mqttfertig
This commit is contained in:
parent
8810b1dcae
commit
660207485a
@ -6,11 +6,8 @@ import com.wasteinformationserver.website.Webserver;
|
|||||||
|
|
||||||
public class main {
|
public class main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
/*
|
|
||||||
com.wasteinformationserver.Date D=new com.wasteinformationserver.Date();
|
|
||||||
D.getdata();
|
|
||||||
D.printList();
|
|
||||||
*/
|
|
||||||
|
|
||||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
@ -28,9 +25,8 @@ public class main {
|
|||||||
|
|
||||||
Log.message("thread started");
|
Log.message("thread started");
|
||||||
|
|
||||||
// mqtt m = new mqtt();
|
mqtt m = new mqtt();
|
||||||
// m.notifymessage();
|
m.notifymessage();
|
||||||
// m.getDatabasedata();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,9 +107,10 @@ public class mqtt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void transmitmessageAbfallart(String tempabfallart) {
|
private void transmitmessageAbfallart(String temp) {
|
||||||
|
|
||||||
mqtttransmitter mt = new mqtttransmitter();
|
mqtttransmitter mt = new mqtttransmitter();
|
||||||
mt.sendmessage(tempabfallart);
|
System.out.println(temp);
|
||||||
|
mt.sendmessage(temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -39,7 +39,7 @@ public class mqtttransmitter {
|
|||||||
System.out.println("Message published");
|
System.out.println("Message published");
|
||||||
sampleClient.disconnect();
|
sampleClient.disconnect();
|
||||||
System.out.println("Disconnected");
|
System.out.println("Disconnected");
|
||||||
System.exit(0);
|
|
||||||
|
|
||||||
} catch (MqttException me) {
|
} catch (MqttException me) {
|
||||||
System.out.println("reason " + me.getReasonCode());
|
System.out.println("reason " + me.getReasonCode());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user