Add Suntech assign headers (fix #5680)

This commit is contained in:
Anton Tananaev
2026-05-13 08:10:51 -07:00
parent 04f74616c9
commit 4dc6bb031a
2 changed files with 13 additions and 0 deletions

View File

@@ -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;

View File

@@ -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");