diff options
author | Anton Tananaev <anton@traccar.org> | 2023-01-23 09:16:10 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-01-23 09:16:10 -0800 |
commit | b77131f4be38295cb643e343613597a6d1ec6562 (patch) | |
tree | 69e4de658d6731b2c060c9b3ab74679613b590f9 /src/main/java/org | |
parent | 0ec73ae585b66a455f7e43ef6d60f41cde6cf960 (diff) | |
download | trackermap-server-b77131f4be38295cb643e343613597a6d1ec6562.tar.gz trackermap-server-b77131f4be38295cb643e343613597a6d1ec6562.tar.bz2 trackermap-server-b77131f4be38295cb643e343613597a6d1ec6562.zip |
GoSafe G6W alarms and temperature
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/WatchProtocolDecoder.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java b/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java index 142d1b64f..6fb626d1d 100644 --- a/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java @@ -263,7 +263,7 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { Position position = decodePosition(deviceSession, buf.toString(StandardCharsets.US_ASCII)); if (type.startsWith("AL")) { - if (position != null) { + if (position != null && !position.hasAttribute(Position.KEY_ALARM)) { position.set(Position.KEY_ALARM, Position.ALARM_GENERAL); } sendResponse(channel, id, index, "AL"); @@ -279,6 +279,7 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { || type.equalsIgnoreCase("HEART") || type.equalsIgnoreCase("BLOOD") || type.equalsIgnoreCase("BPHRT") + || type.equalsIgnoreCase("TEMP") || type.equalsIgnoreCase("btemp2")) { if (buf.isReadable()) { @@ -291,7 +292,9 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { String[] values = buf.toString(StandardCharsets.US_ASCII).split(","); int valueIndex = 0; - if (type.equalsIgnoreCase("btemp2")) { + if (type.equalsIgnoreCase("TEMP")) { + position.set(Position.PREFIX_TEMP + 1, Double.parseDouble(values[valueIndex])); + } else if (type.equalsIgnoreCase("btemp2")) { if (Integer.parseInt(values[valueIndex++]) > 0) { position.set(Position.PREFIX_TEMP + 1, Double.parseDouble(values[valueIndex])); } |