diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-31 21:11:00 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-31 21:11:00 +1200 |
commit | c3be37febe85bbaa69b7112f6d9a04b19b8b9253 (patch) | |
tree | 3fffec289796b4334a555097813517cdf5cf5cf7 /src/org | |
parent | 62028d2d507f54ed50962bdb9dfb027baccb5e1c (diff) | |
download | traccar-server-c3be37febe85bbaa69b7112f6d9a04b19b8b9253.tar.gz traccar-server-c3be37febe85bbaa69b7112f6d9a04b19b8b9253.tar.bz2 traccar-server-c3be37febe85bbaa69b7112f6d9a04b19b8b9253.zip |
Handle full Watch message
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/WatchProtocolDecoder.java | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |