aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/WatchProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-04-09 15:35:39 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-04-09 15:35:39 +1200
commit23c3c2da240e5c44c3d5a04e0714f6f02fa9777e (patch)
tree67deb5b8537b13dea172e8cb4312c5d36f6bc7f4 /src/org/traccar/protocol/WatchProtocolDecoder.java
parentb19babee1118a4ad9833d46ae45d412a8e23e0ce (diff)
downloadtrackermap-server-23c3c2da240e5c44c3d5a04e0714f6f02fa9777e.tar.gz
trackermap-server-23c3c2da240e5c44c3d5a04e0714f6f02fa9777e.tar.bz2
trackermap-server-23c3c2da240e5c44c3d5a04e0714f6f02fa9777e.zip
Decode watch SOS alarms
Diffstat (limited to 'src/org/traccar/protocol/WatchProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/WatchProtocolDecoder.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java
index 68832cd3e..b58c3b6a1 100644
--- a/src/org/traccar/protocol/WatchProtocolDecoder.java
+++ b/src/org/traccar/protocol/WatchProtocolDecoder.java
@@ -242,11 +242,16 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder {
} else if (type.equals("UD") || type.equals("UD2") || type.equals("UD3")
|| type.equals("AL") || type.equals("WT")) {
+ Position position = decodePosition(deviceSession, buf.toString(StandardCharsets.US_ASCII));
+
if (type.equals("AL")) {
+ if (position != null) {
+ position.set(Position.KEY_ALARM, Position.ALARM_SOS);
+ }
sendResponse(channel, id, index, "AL");
}
- return decodePosition(deviceSession, buf.toString(StandardCharsets.US_ASCII));
+ return position;
} else if (type.equals("TKQ")) {