From 44aa9a8afd4720f551fe989c3bfda609c7e6f3bf Mon Sep 17 00:00:00 2001 From: Gregor_Dutzler Date: Fri, 25 Oct 2019 09:36:51 +0200 Subject: [PATCH] mqttfertig --- JavaSample-tcp19216865151883/.lck | 0 src/com/wasteinformationserver/mqtt/mqtt.java | 6 +++--- src/com/wasteinformationserver/mqtt/mqtttransmitter.java | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 JavaSample-tcp19216865151883/.lck diff --git a/JavaSample-tcp19216865151883/.lck b/JavaSample-tcp19216865151883/.lck new file mode 100644 index 0000000..e69de29 diff --git a/src/com/wasteinformationserver/mqtt/mqtt.java b/src/com/wasteinformationserver/mqtt/mqtt.java index d38ec27..6a94129 100644 --- a/src/com/wasteinformationserver/mqtt/mqtt.java +++ b/src/com/wasteinformationserver/mqtt/mqtt.java @@ -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; diff --git a/src/com/wasteinformationserver/mqtt/mqtttransmitter.java b/src/com/wasteinformationserver/mqtt/mqtttransmitter.java index df780fc..ed385ef 100644 --- a/src/com/wasteinformationserver/mqtt/mqtttransmitter.java +++ b/src/com/wasteinformationserver/mqtt/mqtttransmitter.java @@ -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) {