mirror of
https://github.com/traccar/traccar.git
synced 2026-05-19 06:02:22 -04:00
Add Suntech assign headers (fix #5680)
This commit is contained in:
@@ -636,6 +636,15 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
|
||||
}
|
||||
}
|
||||
|
||||
int assignIndex = 1;
|
||||
while (index < values.length) {
|
||||
String value = values[index++];
|
||||
if (!value.isEmpty()) {
|
||||
position.set("assign" + assignIndex, value);
|
||||
}
|
||||
assignIndex++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return position;
|
||||
|
||||
@@ -32,6 +32,10 @@ public class SuntechProtocolDecoderTest extends ProtocolTest {
|
||||
"ALT;0950030205;3FFFFF;95;1.0.11;0;20221017;21:41:30;02F2F402;334;20;0F1D;45;+25.791061;-100.170745;0.00;0.00;18;1;00000101;00000000;42;2;"),
|
||||
Position.KEY_ALARM, Position.ALARM_SOS);
|
||||
|
||||
verifyAttribute(decoder, buffer(
|
||||
"ALT;0950030205;3FFFFF;95;1.0.11;0;20251001;19:34:41;02F2F402;334;20;5B11;28;+25.791061;-100.170745;0.00;0.00;17;1;00000000;00000000;134;1;1440,360,360,360;+23.0;0002;AABBCCDDEEFF"),
|
||||
"assign1", "+23.0");
|
||||
|
||||
verifyAttribute(decoder, buffer(
|
||||
"RES;4309999001;04;02;TEST"),
|
||||
Position.KEY_RESULT, "04;02;TEST");
|
||||
|
||||
Reference in New Issue
Block a user