diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-03 14:08:28 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-03 14:08:28 +1300 |
commit | 092b07eeefc2be317539ab407ce14b21fa6dac32 (patch) | |
tree | 107c7439708d866e617a1f4e6ab8da938d462958 /src/org/traccar | |
parent | 15079797152451e6d04af6527ab4a38209dce1d7 (diff) | |
download | trackermap-server-092b07eeefc2be317539ab407ce14b21fa6dac32.tar.gz trackermap-server-092b07eeefc2be317539ab407ce14b21fa6dac32.tar.bz2 trackermap-server-092b07eeefc2be317539ab407ce14b21fa6dac32.zip |
Decode battery for Watch protocol
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/WatchProtocolDecoder.java | 12 |
1 files changed, 12 insertions, 0 deletions
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")) { |