Erweiterung

This commit is contained in:
Sven committed 2024-03-21 11:12:30 +01:00
1 parent 2d13a5f611
commit 12a351e604
4 files changed
+27 -4

No files matched your search

+4 -4
View File
@@ -131,14 +131,14 @@ class MqttCore {
publishText(String subtopic, String text) {
try {
var compressedText = GZipCodec().encode(utf8.encode(text));
var buffer = Uint8Buffer();
buffer.addAll(utf8.encode(text));
var mqttBuffer = Uint8Buffer();
mqttBuffer.addAll(compressedText);
_mqttClient.publishMessage(subtopic, MqttQos.exactlyOnce, buffer);
var topic = "$_toServerTopic$subtopic/$_clientId";
_mqttClient.publishMessage( topic, MqttQos.exactlyOnce, mqttBuffer);
_mqttClient.publishMessage( topic, MqttQos.exactlyOnce, buffer);
Util.logInfo("send message $text to $topic");
} catch (e) {