aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-05-31 21:11:00 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-05-31 21:11:00 +1200
commitc3be37febe85bbaa69b7112f6d9a04b19b8b9253 (patch)
tree3fffec289796b4334a555097813517cdf5cf5cf7 /src/org/traccar/protocol
parent62028d2d507f54ed50962bdb9dfb027baccb5e1c (diff)
downloadtrackermap-server-c3be37febe85bbaa69b7112f6d9a04b19b8b9253.tar.gz
trackermap-server-c3be37febe85bbaa69b7112f6d9a04b19b8b9253.tar.bz2
trackermap-server-c3be37febe85bbaa69b7112f6d9a04b19b8b9253.zip
Handle full Watch message
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/WatchProtocolDecoder.java5
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;
}