Fehlerkorrekturen und Erweiterungen
This commit is contained in:
1 parent
1f3cc1e995
commit
6c4294512e
8 files changed
+166
-75
No files matched your search
@@ -604,15 +604,19 @@ class MqttCore with ProducerMixin, ConsumerMixin {
|
||||
|
||||
void _startTrackTimer() {
|
||||
_trackTimer ??= Timer.periodic(const Duration(seconds: 120), (Timer t) {
|
||||
var position = MyApp.currentPosition;
|
||||
if (position != null) {
|
||||
var trackMessage = TrackPosition();
|
||||
trackMessage.time = position.timestamp.toIso8601String();
|
||||
trackMessage.lat = position.latitude;
|
||||
trackMessage.long = position.longitude;
|
||||
trackMessage.acc = position.accuracy.toInt();
|
||||
try {
|
||||
var position = MyApp.currentPosition;
|
||||
if (position != null) {
|
||||
var trackMessage = TrackPosition();
|
||||
trackMessage.time = position.timestamp.toIso8601String();
|
||||
trackMessage.lat = position.latitude;
|
||||
trackMessage.long = position.longitude;
|
||||
trackMessage.acc = position.accuracy.toInt();
|
||||
|
||||
_publishMessage("track", trackMessage.toJson(), false);
|
||||
_publishMessage("track", trackMessage.toJson(), false);
|
||||
}
|
||||
} catch (ex) {
|
||||
Util.logException("Error in periodic track timer: {$ex}");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user