From ac9ca0605726344f8a8242198102ccdd9a52635e Mon Sep 17 00:00:00 2001 From: Gavriel Fleischer Date: Mon, 7 Jan 2019 22:14:57 +0200 Subject: log battery level, outdated, invalid --- src/org/traccar/MainEventHandler.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/org') 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); -- cgit v1.2.3