From 2a426882a1a23579f894549a3f01e625d2619169 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 11 Jan 2016 09:19:21 +1300 Subject: Add UDP support for Meitrack protocol --- src/org/traccar/protocol/MeitrackProtocol.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/org') diff --git a/src/org/traccar/protocol/MeitrackProtocol.java b/src/org/traccar/protocol/MeitrackProtocol.java index 6f452aa33..c957d4ea1 100644 --- a/src/org/traccar/protocol/MeitrackProtocol.java +++ b/src/org/traccar/protocol/MeitrackProtocol.java @@ -17,6 +17,8 @@ package org.traccar.protocol; import java.nio.ByteOrder; import java.util.List; + +import org.jboss.netty.bootstrap.ConnectionlessBootstrap; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.string.StringEncoder; @@ -47,6 +49,15 @@ public class MeitrackProtocol extends BaseProtocol { }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); serverList.add(server); + server = new TrackerServer(new ConnectionlessBootstrap(), this.getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("objectDecoder", new MeitrackProtocolDecoder(MeitrackProtocol.this)); + } + }; + server.setEndianness(ByteOrder.LITTLE_ENDIAN); + serverList.add(server); } } -- cgit v1.2.3