aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
index 922431021..a80e84728 100644
--- a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
@@ -37,6 +37,7 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
private int protocolType;
private boolean hbm;
private boolean includeAdc;
+ private boolean includeRpm;
private boolean includeTemp;
public SuntechProtocolDecoder(Protocol protocol) {
@@ -70,6 +71,15 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
deviceId, getProtocolName() + ".includeAdc", includeAdc, true);
}
+ public void setIncludeRpm(boolean includeRpm) {
+ this.includeRpm = includeRpm;
+ }
+
+ public boolean isIncludeRpm(long deviceId) {
+ return Context.getIdentityManager().lookupAttributeBoolean(
+ deviceId, getProtocolName() + ".includeRpm", includeRpm, true);
+ }
+
public void setIncludeTemp(boolean includeTemp) {
this.includeTemp = includeTemp;
}
@@ -338,6 +348,10 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
}
}
+ if (isIncludeRpm(deviceSession.getDeviceId()) && index < values.length) {
+ position.set(Position.KEY_RPM, Integer.parseInt(values[index++]));
+ }
+
if (values.length - index >= 2) {
String driverUniqueId = values[index++];
if (values[index++].equals("1") && !driverUniqueId.isEmpty()) {