From b15c19d95e5494ad91a9370669665b0ef6930160 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 24 Sep 2016 10:30:11 +1200 Subject: Support UDP for Cellocator protocol --- src/org/traccar/protocol/CellocatorProtocol.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/CellocatorProtocol.java b/src/org/traccar/protocol/CellocatorProtocol.java index 6d8eea8f5..69078cca0 100644 --- a/src/org/traccar/protocol/CellocatorProtocol.java +++ b/src/org/traccar/protocol/CellocatorProtocol.java @@ -15,8 +15,11 @@ */ package org.traccar.protocol; +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.StringDecoder; +import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; @@ -40,6 +43,15 @@ public class CellocatorProtocol extends BaseProtocol { }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); serverList.add(server); + + server = new TrackerServer(new ConnectionlessBootstrap(), getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("objectDecoder", new CellocatorProtocolDecoder(CellocatorProtocol.this)); + } + }; + server.setEndianness(ByteOrder.LITTLE_ENDIAN); + serverList.add(server); } } -- cgit v1.2.3