aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/traccar/protocol/EnvotechProtocolDecoder.java4
-rw-r--r--src/test/java/org/traccar/protocol/EnvotechProtocolDecoderTest.java3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/EnvotechProtocolDecoder.java b/src/main/java/org/traccar/protocol/EnvotechProtocolDecoder.java
index 347063547..65d5e3859 100644
--- a/src/main/java/org/traccar/protocol/EnvotechProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/EnvotechProtocolDecoder.java
@@ -48,7 +48,8 @@ public class EnvotechProtocolDecoder extends BaseProtocolDecoder {
.number("(ddd),") // battery
.number("(xx)") // inputs
.number("(xx),") // outputs
- .number("(xxx)?,") // fuel
+ .number("(xxx)?") // fuel
+ .number("(xxx)?,") // weight
.number("(x{8}),") // status
.expression("[^']*'")
.number("(dd)(dd)(dd)") // date (ddmmyy)
@@ -99,6 +100,7 @@ public class EnvotechProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_INPUT, parser.nextHexInt());
position.set(Position.PREFIX_OUT, parser.nextHexInt());
position.set(Position.KEY_FUEL_LEVEL, parser.nextHexInt());
+ position.set("weight", parser.nextHexInt());
position.set(Position.KEY_STATUS, parser.nextHexLong());
position.setFixTime(parser.nextDateTime(Parser.DateTimeFormat.DMY_HMS));
diff --git a/src/test/java/org/traccar/protocol/EnvotechProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/EnvotechProtocolDecoderTest.java
index 70fb5a188..0809a1e9a 100644
--- a/src/test/java/org/traccar/protocol/EnvotechProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/EnvotechProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class EnvotechProtocolDecoderTest extends ProtocolTest {
var decoder = new EnvotechProtocolDecoder(null);
verifyPosition(decoder, text(
+ "$80IVM,03,E002215,E002215,110422061936,672763902,126423,0180,000000,00018600,0.0000'11042206193710406325S03966094E000118*42D6#"));
+
+ verifyPosition(decoder, text(
"$80SLM,62,000F,F015727,020522053200,611000000,000391,C080,000,80028900,85010000'02052205320110399426S03970217E000145*E0C2#"));
verifyPosition(decoder, text(