diff options
author | Anton Tananaev <anton@traccar.org> | 2023-09-19 06:30:29 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-09-19 06:30:37 -0700 |
commit | 7ce4fb9a628f1875ee7b616bbd3a03a6be008a0d (patch) | |
tree | 05be2bd6c3d28d8e5c25d3cca3bed6eb8c1f6a11 | |
parent | 070cb02751a29eb746a5b2c1797dcbe26e5af9ad (diff) | |
download | trackermap-server-7ce4fb9a628f1875ee7b616bbd3a03a6be008a0d.tar.gz trackermap-server-7ce4fb9a628f1875ee7b616bbd3a03a6be008a0d.tar.bz2 trackermap-server-7ce4fb9a628f1875ee7b616bbd3a03a6be008a0d.zip |
Handle long odometer values
-rw-r--r-- | src/main/java/org/traccar/protocol/StartekProtocolDecoder.java | 2 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java index 9c749c8d9..5cfbb36ca 100644 --- a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java @@ -178,7 +178,7 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder { position.setCourse(parser.nextInt()); position.setAltitude(parser.nextInt()); - position.set(Position.KEY_ODOMETER, parser.nextInt()); + position.set(Position.KEY_ODOMETER, parser.nextLong()); position.setNetwork(new Network(CellTower.from( parser.nextInt(), parser.nextInt(), parser.nextHexInt(), parser.nextHexInt(), parser.nextInt()))); diff --git a/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java index 9b1362f5d..94b3fd256 100644 --- a/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class StartekProtocolDecoderTest extends ProtocolTest { var decoder = inject(new StartekProtocolDecoder(null)); + verifyPosition(decoder, text( + "&&l141,863911061945394,000,0,,230918072531,A,22.678598,114.045970,26,0.6,0,0,74,2286304571,460|0|249F|00001093,20,001C,00,00,04A7|019C|0000|0000,1,C0")); + verifyAttribute(decoder, text( "&&s148,868703050178631,000,37,,230704040211,A,22.678565,114.046011,31,0.5,0,339,77,8,460|0|249F|0AC2620D,27,0000001D,02,00,04F2|01A1|0000|0000,129,,,,949037"), Position.KEY_HOURS, 9490000L); |