diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-17 16:56:45 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-09-17 16:56:45 +1200 |
commit | 99bf70e274fbfb03e0f65c564d7c9f5bdaf115c4 (patch) | |
tree | 49963bb0f56146d9daee49aa332c81fa72ee57ce /src/org/traccar/protocol/AnytrekProtocol.java | |
parent | 9587c1671abcb1d255bc9715c3b254006b761152 (diff) | |
download | trackermap-server-99bf70e274fbfb03e0f65c564d7c9f5bdaf115c4.tar.gz trackermap-server-99bf70e274fbfb03e0f65c564d7c9f5bdaf115c4.tar.bz2 trackermap-server-99bf70e274fbfb03e0f65c564d7c9f5bdaf115c4.zip |
Implement Anytrek VT1611 protocol
Diffstat (limited to 'src/org/traccar/protocol/AnytrekProtocol.java')
-rw-r--r-- | src/org/traccar/protocol/AnytrekProtocol.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/AnytrekProtocol.java b/src/org/traccar/protocol/AnytrekProtocol.java new file mode 100644 index 000000000..8616e9194 --- /dev/null +++ b/src/org/traccar/protocol/AnytrekProtocol.java @@ -0,0 +1,42 @@ +/* + * Copyright 2018 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 io.netty.handler.codec.LengthFieldBasedFrameDecoder; +import org.traccar.BaseProtocol; +import org.traccar.PipelineBuilder; +import org.traccar.TrackerServer; + +import java.util.List; + +public class AnytrekProtocol extends BaseProtocol { + + public AnytrekProtocol() { + super("anytrek"); + } + + @Override + public void initTrackerServers(List<TrackerServer> serverList) { + serverList.add(new TrackerServer(false, getName()) { + @Override + protected void addProtocolHandlers(PipelineBuilder pipeline) { + pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, 2, 0)); + pipeline.addLast("objectDecoder", new AnytrekProtocolDecoder(AnytrekProtocol.this)); + } + }); + } + +} |