aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/H02Protocol.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-09-13 23:17:23 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-09-13 23:17:23 +1200
commit0aeeac33163640bbbe23560cbd108ddf290ac873 (patch)
treef71992badef2008aea319a87397658d7129f10f2 /src/org/traccar/protocol/H02Protocol.java
parentd454901a5ff831eaee30db23df12556b6442693a (diff)
downloadtrackermap-server-0aeeac33163640bbbe23560cbd108ddf290ac873.tar.gz
trackermap-server-0aeeac33163640bbbe23560cbd108ddf290ac873.tar.bz2
trackermap-server-0aeeac33163640bbbe23560cbd108ddf290ac873.zip
Message length parameter for H02 frame decoder
Diffstat (limited to 'src/org/traccar/protocol/H02Protocol.java')
-rw-r--r--src/org/traccar/protocol/H02Protocol.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/H02Protocol.java b/src/org/traccar/protocol/H02Protocol.java
index 72b4f903d..cdc2d11bb 100644
--- a/src/org/traccar/protocol/H02Protocol.java
+++ b/src/org/traccar/protocol/H02Protocol.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.handler.codec.string.StringEncoder;
import org.traccar.BaseProtocol;
+import org.traccar.Context;
import org.traccar.TrackerServer;
import org.traccar.model.Command;
@@ -42,7 +43,8 @@ public class H02Protocol extends BaseProtocol {
serverList.add(new TrackerServer(new ServerBootstrap(), this.getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
- pipeline.addLast("frameDecoder", new H02FrameDecoder());
+ int messageLength = Context.getConfig().getInteger(getName() + ".messageLength", 32);
+ pipeline.addLast("frameDecoder", new H02FrameDecoder(messageLength));
pipeline.addLast("stringEncoder", new StringEncoder());
pipeline.addLast("objectEncoder", new H02ProtocolEncoder());
pipeline.addLast("objectDecoder", new H02ProtocolDecoder(H02Protocol.this));