Erweiterungen
This commit is contained in:
1 parent
a987983b63
commit
85e973c3dd
3 files changed
+13
-4
No files matched your search
@@ -104,7 +104,7 @@ class MqttCore {
|
||||
|
||||
_mqttClient = MqttServerClient.withPort(_brokerUri, clientId, _brokerPort);
|
||||
_mqttClient!.logging(on: false);
|
||||
_mqttClient!.keepAlivePeriod = 5;
|
||||
_mqttClient!.keepAlivePeriod = 60;
|
||||
_mqttClient!.disconnectOnNoResponsePeriod = 10;
|
||||
_mqttClient!.autoReconnect = true;
|
||||
_mqttClient!.onDisconnected = _clientDisconnected;
|
||||
@@ -146,6 +146,7 @@ class MqttCore {
|
||||
_mqttClient!.publishMessage(messageTopic, MqttQos.exactlyOnce, buffer);
|
||||
|
||||
Util.logInfo("message\n$text\nsend to $messageTopic");
|
||||
Util.logInfo("size in bytes: ${buffer.length}");
|
||||
|
||||
return true;
|
||||
} catch (ex) {
|
||||
@@ -170,6 +171,7 @@ class MqttCore {
|
||||
var topic = topicArraySplited[6];
|
||||
|
||||
Util.logInfo('message received\ntopic: $topic\n');
|
||||
Util.logInfo("size in bytes: ${message.payload.message.length.toString()}");
|
||||
|
||||
var messageBytes = message.payload.message;
|
||||
String payload = utf8.decode(GZipDecoder().decodeBytes(messageBytes));
|
||||
@@ -484,7 +486,7 @@ class MqttCore {
|
||||
}
|
||||
|
||||
void _startTrackTimer() {
|
||||
_trackTimer ??= Timer.periodic(const Duration(seconds: 60), (Timer t) {
|
||||
_trackTimer ??= Timer.periodic(const Duration(seconds: 120), (Timer t) {
|
||||
var position = MyApp.currentPosition;
|
||||
if (position != null) {
|
||||
var trackMessage = TrackPosition();
|
||||
|
||||
Reference in new issue
Block a user