aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 2d3788720..33d364cc4 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -497,17 +497,16 @@ public class ServerManager {
private void initPt502Server(String protocol) throws SQLException {
if (isProtocolEnabled(properties, protocol)) {
- serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {
+ TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
- byte delimiter[] = { (byte) '\r', (byte) '\n' };
- pipeline.addLast("frameDecoder",
- new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter)));
+ pipeline.addLast("frameDecoder", new Pt502FrameDecoder());
pipeline.addLast("stringDecoder", new StringDecoder());
- pipeline.addLast("stringEncoder", new StringEncoder());
pipeline.addLast("objectDecoder", new Pt502ProtocolDecoder(ServerManager.this));
}
- });
+ };
+ server.setEndianness(ByteOrder.LITTLE_ENDIAN);
+ serverList.add(server);
}
}