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(" "); String[] partstwo = date.split(" ");
boolean abholtag; int abholtag;
if (partstwo[0].contains(newDate)) { if (partstwo[0].contains(newDate)) {
abholtag = true; abholtag = 1;
} else { } else {
abholtag = false; abholtag = 0;
} }
temp = tempabfallart + "," + abholtag; temp = tempabfallart + "," + abholtag;

View File

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