diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-01-11 09:19:21 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-01-11 09:20:01 +1300 |
commit | 2a426882a1a23579f894549a3f01e625d2619169 (patch) | |
tree | feb2002fec2fc5ea7ebe9faa662c33a8c3a3aaee /src/org/traccar | |
parent | cddcc4634e720cd365c5703cad149fd2f44de7ad (diff) | |
download | trackermap-server-2a426882a1a23579f894549a3f01e625d2619169.tar.gz trackermap-server-2a426882a1a23579f894549a3f01e625d2619169.tar.bz2 trackermap-server-2a426882a1a23579f894549a3f01e625d2619169.zip |
Add UDP support for Meitrack protocol
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/MeitrackProtocol.java | 11 |
1 files changed, 11 insertions, 0 deletions
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); } } |