diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-12 17:19:32 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-12 17:19:32 -0700 |
commit | 78a3d28440b4de89eaab79664fef512e6e869030 (patch) | |
tree | c65cbe10cfd571d66710a8c93c9800c97aa006d6 /src | |
parent | b8f0c159aa3e13e902305e4b68ad7f851696b69c (diff) | |
download | trackermap-server-78a3d28440b4de89eaab79664fef512e6e869030.tar.gz trackermap-server-78a3d28440b4de89eaab79664fef512e6e869030.tar.bz2 trackermap-server-78a3d28440b4de89eaab79664fef512e6e869030.zip |
Support Envotech IVM format
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/EnvotechProtocolDecoder.java | 4 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/EnvotechProtocolDecoderTest.java | 3 |
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( |