diff options
author | Ivan Muratov <binakot@gmail.com> | 2017-07-13 08:30:35 +0300 |
---|---|---|
committer | Ivan Muratov <binakot@gmail.com> | 2017-07-13 08:30:35 +0300 |
commit | 6e70a873886b366980423e448808b60c624e4047 (patch) | |
tree | 905021251f4174ab2eb4d01ff2587c86e1b8314a /src/org/traccar/protocol/Arnavi4Protocol.java | |
parent | 2e0ed3ccfde8f779111de2b722a94224faa65c99 (diff) | |
download | trackermap-server-6e70a873886b366980423e448808b60c624e4047.tar.gz trackermap-server-6e70a873886b366980423e448808b60c624e4047.tar.bz2 trackermap-server-6e70a873886b366980423e448808b60c624e4047.zip |
Basic ARNAVI4 binary protocol implementation is done.
Supported 2 types of HEADER packets (v1, v2).
Supported 3 types of PACKAGE DATA records: latitude, longitude and additional data (speed, satellites, altitude, course).
Diffstat (limited to 'src/org/traccar/protocol/Arnavi4Protocol.java')
-rw-r--r-- | src/org/traccar/protocol/Arnavi4Protocol.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/Arnavi4Protocol.java b/src/org/traccar/protocol/Arnavi4Protocol.java index 622051fbd..227397980 100644 --- a/src/org/traccar/protocol/Arnavi4Protocol.java +++ b/src/org/traccar/protocol/Arnavi4Protocol.java @@ -2,12 +2,10 @@ package org.traccar.protocol; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; -import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder; -import org.jboss.netty.handler.codec.string.StringDecoder; -import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; +import java.nio.ByteOrder; import java.util.List; /** @@ -21,15 +19,15 @@ public class Arnavi4Protocol extends BaseProtocol { @Override public void initTrackerServers(List<TrackerServer> serverList) { - serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { + TrackerServer server = new TrackerServer(new ServerBootstrap(), getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("frameDecoder", new Arnavi4FrameDecoder()); pipeline.addLast("objectDecoder", new Arnavi4ProtocolDecoder(Arnavi4Protocol.this)); } - }); + }; + server.setEndianness(ByteOrder.LITTLE_ENDIAN); + serverList.add(server); } } |