mirror of
https://github.com/traccar/traccar.git
synced 2025-01-07 03:07:01 +08:00
iStartek DLT driver id (fix #5477)
This commit is contained in:
parent
1274f6b0bd
commit
d881014603
@ -90,6 +90,7 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder {
|
||||
.number("(d+)?|") // instant fuel
|
||||
.number("(d+)[%L]").optional() // fuel level
|
||||
.groupEnd("?")
|
||||
.expression(",([^,]{20,})").optional() // driver id
|
||||
.number(",(d+)").optional() // hours
|
||||
.groupEnd("?")
|
||||
.groupEnd("?")
|
||||
@ -236,6 +237,10 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder {
|
||||
position.set(Position.KEY_FUEL_LEVEL, parser.nextInt());
|
||||
}
|
||||
|
||||
if (parser.hasNext()) {
|
||||
position.set(Position.KEY_DRIVER_UNIQUE_ID, parser.next());
|
||||
}
|
||||
|
||||
if (parser.hasNext()) {
|
||||
position.set(Position.KEY_HOURS, parser.nextInt() * 1000L);
|
||||
}
|
||||
|
@ -11,6 +11,10 @@ public class StartekProtocolDecoderTest extends ProtocolTest {
|
||||
|
||||
var decoder = inject(new StartekProtocolDecoder(null));
|
||||
|
||||
verifyAttribute(decoder, text(
|
||||
"&&L171,868825064282040,000,0,,241209063302,A,13.809656,100.558255,14,0.9,0,0,67,1560,520|4|A418|008AAC3F,31,000000BD,02,00,04E3|0171|0000|0000,131,,,,3100 1 61000541 10800 ?FE\r\n"),
|
||||
Position.KEY_DRIVER_UNIQUE_ID, "3100 1 61000541 10800 ?");
|
||||
|
||||
verifyAttributes(decoder, text(
|
||||
"&&\\546,865491061145970,710,T1,0.0,0.0,0.0,0.0,0,0,0,0,0.0,0,0.0,0,F0,0.0,0.0,0.0,0.0,0.0,0,0.0,0,0,0,0,0,1,0,0.0,00,0.0,0.0,0.0,0\r\n",
|
||||
"T2,0.000,0.0,9223372036854775808.8,9223372036854775808.8,4294967295,4294967295,0,429496729,0,0,0,0,0,0,0,0,0,0,0.0,21474836.0,9223372036854775808.8,0,00,0,0,0.00\r\n",
|
||||
|
Loading…
Reference in New Issue
Block a user