aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/SuntechProtocolDecoderTest.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
index 938d290c0..52fdaa05c 100644
--- a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
@@ -400,7 +400,7 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
}
}
} else {
- position.set("serial", attribute);
+ position.set("serial", attribute.trim());
}
remaining -= attribute.length() + 1;
}
diff --git a/src/test/java/org/traccar/protocol/SuntechProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/SuntechProtocolDecoderTest.java
index 71f71ce99..30959c8b9 100644
--- a/src/test/java/org/traccar/protocol/SuntechProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/SuntechProtocolDecoderTest.java
@@ -96,6 +96,10 @@ public class SuntechProtocolDecoderTest extends ProtocolTest {
"53543330305545583b3531313639393339383b34353b3331353b32303232303632333b31383a32343a35383b3661313332393b2d32392e3735343934373b2d3035372e3038353838353b3030302e3030303b3030302e30303b31303b313b37323b302e30303b3030303030303b31323b0201100110011090011001100110011001100110fe3b39303b3030303030303b332e393b313b30303030303030303030303030303b30"));
verifyAttribute(decoder, buffer(
+ "ST300UEX;511248287;45;311;20220701;18:42:08;14c943;-22.975257;-043.373065;000.000;000.00;0;0;0;12.14;100010;19;RFID:008FB2BEBA39\r\n;3E;000135;4.1;1;00000000000000;0"),
+ "serial", "RFID:008FB2BEBA39");
+
+ verifyAttribute(decoder, buffer(
"ST300UEX;100850000;01;010;20081017;07:41:56;2F100;+37.478519;+126.886819;000.012;000.00;9;1;0;15.30;001100;25;Welcome to Suntech World!;12;0;4.5;1"),
"serial", "Welcome to Suntech World!");