aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/DingtekProtocol.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-05-29 23:11:19 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-05-29 23:11:19 -0700
commitc524d170f3324ccf10944887faa3d9f35e99e31a (patch)
tree15ddad1449f81cbad53f266665eddbc7615599f6 /src/main/java/org/traccar/protocol/DingtekProtocol.java
parentab1022d0c571af09b2036f8694db71537fa430cd (diff)
downloadtraccar-server-c524d170f3324ccf10944887faa3d9f35e99e31a.tar.gz
traccar-server-c524d170f3324ccf10944887faa3d9f35e99e31a.tar.bz2
traccar-server-c524d170f3324ccf10944887faa3d9f35e99e31a.zip
Fix protocol decoding
Diffstat (limited to 'src/main/java/org/traccar/protocol/DingtekProtocol.java')
-rw-r--r--src/main/java/org/traccar/protocol/DingtekProtocol.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/DingtekProtocol.java b/src/main/java/org/traccar/protocol/DingtekProtocol.java
index 31962202c..cf2a6c0f5 100644
--- a/src/main/java/org/traccar/protocol/DingtekProtocol.java
+++ b/src/main/java/org/traccar/protocol/DingtekProtocol.java
@@ -15,7 +15,8 @@
*/
package org.traccar.protocol;
-import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
+import io.netty.handler.codec.string.StringDecoder;
+import io.netty.handler.codec.string.StringEncoder;
import org.traccar.BaseProtocol;
import org.traccar.PipelineBuilder;
import org.traccar.TrackerServer;
@@ -26,7 +27,9 @@ public class DingtekProtocol extends BaseProtocol {
addServer(new TrackerServer(false, getName()) {
@Override
protected void addProtocolHandlers(PipelineBuilder pipeline) {
- pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 4, 1));
+ pipeline.addLast(new DingtekFrameDecoder());
+ pipeline.addLast(new StringDecoder());
+ pipeline.addLast(new StringEncoder());
pipeline.addLast(new DingtekProtocolDecoder(DingtekProtocol.this));
}
});