From c3be37febe85bbaa69b7112f6d9a04b19b8b9253 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 31 May 2017 21:11:00 +1200 Subject: Handle full Watch message --- src/org/traccar/protocol/WatchProtocolDecoder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java index f0d06a3cc..ad43215a2 100644 --- a/src/org/traccar/protocol/WatchProtocolDecoder.java +++ b/src/org/traccar/protocol/WatchProtocolDecoder.java @@ -65,7 +65,7 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { .number("d+,") // tumbles .number("(x+),") // status .expression("([^\\]]*)") // cell and wifi - .text("]").optional() + .text("]") .compile(); private void sendResponse(Channel channel, String manufacturer, String id, String content) { @@ -160,7 +160,8 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { getLastLocation(position, null); - position.set(Position.KEY_BATTERY_LEVEL, Integer.parseInt(values[3])); + position.set(Position.KEY_BATTERY_LEVEL, + Integer.parseInt(values[3].substring(0, values[3].length() - 1))); return position; } -- cgit v1.2.3