aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorGavriel Fleischer <flocsy@gmail.com>2019-01-07 22:14:57 +0200
committerGavriel Fleischer <flocsy@gmail.com>2019-01-07 22:14:57 +0200
commitac9ca0605726344f8a8242198102ccdd9a52635e (patch)
tree4c01db073753263d88b06e61abe5e51d10e9a843 /src/org
parent19b13e0efd3c52df2a1dcaf7204342ffe6cdaec5 (diff)
downloadtraccar-server-ac9ca0605726344f8a8242198102ccdd9a52635e.tar.gz
traccar-server-ac9ca0605726344f8a8242198102ccdd9a52635e.tar.bz2
traccar-server-ac9ca0605726344f8a8242198102ccdd9a52635e.zip
log battery level, outdated, invalid
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/MainEventHandler.java10
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);