Fehlerkorrekturen und Erweiterungen
This commit is contained in:
1 parent
6c4294512e
commit
b3d010b453
29 files changed
+430
-212
No files matched your search
@@ -136,6 +136,10 @@ class MqttCore with ProducerMixin, ConsumerMixin {
|
||||
connectionLostMessage.connectionLost = true;
|
||||
var connectionLostEncapsulatedMessage = _encapsulateMessage(const Uuid().v4(), false, connectionLostMessage.toJson());
|
||||
|
||||
var willMessageUtf8 = utf8.encode(connectionLostEncapsulatedMessage);
|
||||
Uint8Buffer uint8Buffer = Uint8Buffer();
|
||||
uint8Buffer.addAll(willMessageUtf8);
|
||||
|
||||
_mqttClient!.connectionMessage = MqttConnectMessage()
|
||||
.withClientIdentifier(Util.getAppUuid())
|
||||
.authenticateAs("app", "apppwd")
|
||||
@@ -144,7 +148,7 @@ class MqttCore with ProducerMixin, ConsumerMixin {
|
||||
.withWillTopic("$_toServerTopic$_clientId/connection_lost")
|
||||
.withWillQos(MqttQos.atMostOnce)
|
||||
.keepAliveFor(60)
|
||||
.withWillPayload(MqttUtf8Encoding().toUtf8(connectionLostEncapsulatedMessage))
|
||||
.withWillPayload(uint8Buffer)
|
||||
.will();
|
||||
}
|
||||
|
||||
@@ -320,14 +324,13 @@ class MqttCore with ProducerMixin, ConsumerMixin {
|
||||
await MyApp.isarInstance.sessionStatus.put(sessionStatusMessage);
|
||||
});
|
||||
|
||||
// TODO MESSAGING
|
||||
Util.preferencesSaveBool(Constants.prefsBWVEnabled, sessionStatusMessage.bwvEnabled);
|
||||
|
||||
sendMessage(
|
||||
routingKey: Constants.messageTopicSessionStatusInfoUpdate,
|
||||
payload: SessionStatusInfoUpdate(status: sessionStatusMessage),
|
||||
);
|
||||
|
||||
//await MessageService().publish<SessionStatusInfoUpdate>(Constants.messageTopicSessionStatusInfoUpdate, arguments: SessionStatusInfoUpdate(status: sessionStatusMessage));
|
||||
|
||||
_startTrackTimer();
|
||||
}
|
||||
|
||||
@@ -585,10 +588,18 @@ class MqttCore with ProducerMixin, ConsumerMixin {
|
||||
}
|
||||
|
||||
_sendSyncMessage() async {
|
||||
var currentPosition = MyApp.currentPosition;
|
||||
|
||||
var jobs = await MyApp.isarInstance.jobs.filter().stateGreaterThan(-1).findAll();
|
||||
|
||||
var answer = SyncJobsMessage();
|
||||
answer.utcUnixTime = DateTime.now().toUtc().millisecondsSinceEpoch ~/ 1000;
|
||||
|
||||
answer.pos = SyncMessagePos();
|
||||
answer.pos!.lat = currentPosition != null ? currentPosition.latitude : 0.0;
|
||||
answer.pos!.long = currentPosition != null ? currentPosition.longitude : 0.0;
|
||||
answer.pos!.acc = currentPosition != null ? currentPosition.accuracy.toInt() : 0;
|
||||
|
||||
answer.sync = SyncJobMessageSync();
|
||||
answer.sync.jobs = [];
|
||||
for (var job in jobs) {
|
||||
|
||||
Reference in new issue
Block a user