diff options
author | Gavriel Fleischer <flocsy@gmail.com> | 2019-01-07 22:14:57 +0200 |
---|---|---|
committer | Gavriel Fleischer <flocsy@gmail.com> | 2019-01-07 22:14:57 +0200 |
commit | ac9ca0605726344f8a8242198102ccdd9a52635e (patch) | |
tree | 4c01db073753263d88b06e61abe5e51d10e9a843 /src/org/traccar/MainEventHandler.java | |
parent | 19b13e0efd3c52df2a1dcaf7204342ffe6cdaec5 (diff) | |
download | trackermap-server-ac9ca0605726344f8a8242198102ccdd9a52635e.tar.gz trackermap-server-ac9ca0605726344f8a8242198102ccdd9a52635e.tar.bz2 trackermap-server-ac9ca0605726344f8a8242198102ccdd9a52635e.zip |
log battery level, outdated, invalid
Diffstat (limited to 'src/org/traccar/MainEventHandler.java')
-rw-r--r-- | src/org/traccar/MainEventHandler.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/org/traccar/MainEventHandler.java b/src/org/traccar/MainEventHandler.java index 8ca73dd77..3a8e36146 100644 --- a/src/org/traccar/MainEventHandler.java +++ b/src/org/traccar/MainEventHandler.java @@ -71,6 +71,16 @@ public class MainEventHandler extends ChannelInboundHandlerAdapter { if (position.getAccuracy() > 0) { s.append(", accuracy: ").append(String.format("%.1f", position.getAccuracy())); } + if (position.getOutdated()) { + s.append(", outdated"); + } + if (!position.getValid()) { + s.append(", invalid"); + } + Object batteryLevel = position.getInteger(Position.KEY_BATTERY_LEVEL); + if (batteryLevel != null) { + s.append(", battery: ").append(batteryLevel).append('%'); + } Object cmdResult = position.getAttributes().get(Position.KEY_RESULT); if (cmdResult != null) { s.append(", result: ").append(cmdResult); |