From 23c3c2da240e5c44c3d5a04e0714f6f02fa9777e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 9 Apr 2018 15:35:39 +1200 Subject: Decode watch SOS alarms --- src/org/traccar/protocol/WatchProtocolDecoder.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/protocol') 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")) { -- cgit v1.2.3