aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java
index c97017d65..76278070e 100644
--- a/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java
@@ -164,20 +164,15 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
break;
case "IWD":
while (index < values.length) {
- index += 1; // data identifier
+ int sensorIndex = Integer.parseInt(values[index++]);
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++]));
-
+ position.set(Position.PREFIX_TEMP + sensorIndex, Double.parseDouble(values[index++]));
}
}
-
- if (index < values.length && values[index + 1].equals("0")) {
- position.set(Position.KEY_DRIVER_UNIQUE_ID, values[index + 2]);
- }
break;
default:
break;