Commit a966bb62 authored by René Schöne's avatar René Schöne
Browse files

Use retain for initial robot config.

- see #26
parent 465ddf3b
Pipeline #7084 passed with stages
in 4 minutes and 54 seconds
......@@ -231,8 +231,16 @@ public class MqttUpdater {
}
public void publish(String topic, byte[] bytes) {
publish(topic, bytes, false);
}
public void publish(String topic, byte[] bytes, boolean retain) {
publish(topic, bytes, this.qos, retain);
}
public void publish(String topic, byte[] bytes, org.fusesource.mqtt.client.QoS qos, boolean retain) {
connection.getDispatchQueue().execute(() -> {
connection.publish(topic, bytes, qos, false, new org.fusesource.mqtt.client.Callback<Void>() {
connection.publish(topic, bytes, qos, retain, new org.fusesource.mqtt.client.Callback<Void>() {
@Override
public void onSuccess(Void value) {
logger.debug("Published some bytes to {}", topic);
......
......@@ -104,7 +104,7 @@ public class StarterMain {
.setEnableTwistLinear(false)
.setPublishRate(100)
.build();
mainHandler.publish(dataConfigTopic, dataConfig.toByteArray());
mainHandler.publish(dataConfigTopic, dataConfig.toByteArray(), true);
}
private void logStatus(String prefix, RobotArm robotArm) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment