diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java index ebc7e7c04..c97017d65 100644 --- a/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java @@ -163,6 +163,18 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { position.set("tagData", values[index++]); break; case "IWD": + while (index < values.length) { + index += 1; // data identifier + int dataType = Integer.parseInt(values[index++]); + if (dataType == 0) { + position.set(Position.KEY_DRIVER_UNIQUE_ID, values[index++]); + } else if (dataType == 1) { + index += 1; // temperature sensor serial number + position.set(Position.PREFIX_TEMP + 1, Double.parseDouble(values[index++])); + + } + } + if (index < values.length && values[index + 1].equals("0")) { position.set(Position.KEY_DRIVER_UNIQUE_ID, values[index + 2]); } |