mqttfertig

This commit is contained in:
Gregor_Dutzler 2019-10-25 09:36:51 +02:00
parent 08fd25124c
commit 44aa9a8afd
3 changed files with 5 additions and 4 deletions

View File

View File

@ -85,11 +85,11 @@ public class mqtt {
String[] partstwo = date.split(" ");
boolean abholtag;
int abholtag;
if (partstwo[0].contains(newDate)) {
abholtag = true;
abholtag = 1;
} else {
abholtag = false;
abholtag = 0;
}
temp = tempabfallart + "," + abholtag;

View File

@ -24,9 +24,9 @@ public class mqtttransmitter {
String clientId = "JavaSample";
MemoryPersistence persistence = new MemoryPersistence();
System.out.println("HI");
try {
MqttClient sampleClient = new MqttClient(broker, clientId, persistence);
MqttConnectOptions connOpts = new MqttConnectOptions();
connOpts.setCleanSession(true);
@ -40,6 +40,7 @@ public class mqtttransmitter {
Log.debug("Message published");
sampleClient.disconnect();
Log.debug("Disconnected");
System.out.println("HI");
} catch (MqttException me) {