diff options
author | Shinryuken <watertext@hotmail.it> | 2017-11-19 11:22:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-19 11:22:31 +0100 |
commit | a5b273f8f8afd1a67613517c6487642601070456 (patch) | |
tree | babc63f5d50977fc91b3946b1da2e86ec74c51a5 /src/org/traccar/protocol/Ivt401Protocol.java | |
parent | c7928ef4a722cb40e9911c8e76e308fc48c85567 (diff) | |
parent | fb9cbb2b74dc0060bd0dc5d0b3bfeb958ed6f3b5 (diff) | |
download | traccar-server-a5b273f8f8afd1a67613517c6487642601070456.tar.gz traccar-server-a5b273f8f8afd1a67613517c6487642601070456.tar.bz2 traccar-server-a5b273f8f8afd1a67613517c6487642601070456.zip |
Merge branch 'master' into payload-as-form-param
Diffstat (limited to 'src/org/traccar/protocol/Ivt401Protocol.java')
-rw-r--r-- | src/org/traccar/protocol/Ivt401Protocol.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Ivt401Protocol.java b/src/org/traccar/protocol/Ivt401Protocol.java new file mode 100644 index 000000000..b58601ba1 --- /dev/null +++ b/src/org/traccar/protocol/Ivt401Protocol.java @@ -0,0 +1,45 @@ +/* + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.bootstrap.ServerBootstrap; +import org.jboss.netty.channel.ChannelPipeline; +import org.jboss.netty.handler.codec.string.StringDecoder; +import org.traccar.BaseProtocol; +import org.traccar.CharacterDelimiterFrameDecoder; +import org.traccar.TrackerServer; + +import java.util.List; + +public class Ivt401Protocol extends BaseProtocol { + + public Ivt401Protocol() { + super("ivt401"); + } + + @Override + public void initTrackerServers(List<TrackerServer> serverList) { + serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ';')); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new Ivt401ProtocolDecoder(Ivt401Protocol.this)); + } + }); + } + +} |