aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/TechTltProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/TechTltProtocolDecoderTest.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/TechTltProtocolDecoder.java b/src/main/java/org/traccar/protocol/TechTltProtocolDecoder.java
index 046e7a748..17f5c80fa 100644
--- a/src/main/java/org/traccar/protocol/TechTltProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TechTltProtocolDecoder.java
@@ -119,7 +119,7 @@ public class TechTltProtocolDecoder extends BaseProtocolDecoder {
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
- String sentence = (String) msg;
+ String sentence = ((String) msg).trim();
if (sentence.contains("INFO")) {
return decodeStatus(channel, remoteAddress, sentence);
} else if (sentence.contains("POS")) {
diff --git a/src/test/java/org/traccar/protocol/TechTltProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/TechTltProtocolDecoderTest.java
index 0e480d835..767f175fe 100644
--- a/src/test/java/org/traccar/protocol/TechTltProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/TechTltProtocolDecoderTest.java
@@ -11,11 +11,11 @@ public class TechTltProtocolDecoderTest extends ProtocolTest {
TechTltProtocolDecoder decoder = new TechTltProtocolDecoder(null);
verifyPosition(decoder, text(
- "002422269*POS=Y,16:21:20,25/11/09,3809.8063N,01444.7438E,4.17,117.23,0.4,09,40076,56341"),
+ "002422269*POS=Y,16:21:20,25/11/09,3809.8063N,01444.7438E,4.17,117.23,0.4,09,40076,56341\r\n"),
position("2009-11-25 16:21:20.000", true, 38.16344, 14.74573));
verifyAttributes(decoder, text(
- "002422269,INFOGPRS,V Bat=13.8,TEMP=23,I TIM,15"));
+ "002422269,INFOGPRS,V Bat=13.8,TEMP=23,I TIM,15\r\n"));
}