From 092b07eeefc2be317539ab407ce14b21fa6dac32 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 3 Nov 2015 14:08:28 +1300 Subject: Decode battery for Watch protocol --- src/org/traccar/protocol/WatchProtocolDecoder.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/org/traccar') diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java index 4d71a7f5d..a24d0a56b 100644 --- a/src/org/traccar/protocol/WatchProtocolDecoder.java +++ b/src/org/traccar/protocol/WatchProtocolDecoder.java @@ -91,6 +91,18 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { sendResponse(channel, manufacturer, id, "LK"); + if (!content.isEmpty()) { + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(getDeviceId()); + + getLastLocation(position, null); + + position.set(Event.KEY_BATTERY, content.split(",")[3]); + + return position; + } + } else if (type.equals("UD") || type.equals("UD2") || type.equals("AL")) { if (type.equals("AL")) { -- cgit v1.2.3