mqttfertig
This commit is contained in:
parent
08fd25124c
commit
44aa9a8afd
0
JavaSample-tcp19216865151883/.lck
Normal file
0
JavaSample-tcp19216865151883/.lck
Normal 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;
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user