diff options
author | ninioe <ninioe@gmail.com> | 2016-08-07 09:56:04 +0300 |
---|---|---|
committer | ninioe <ninioe@gmail.com> | 2016-08-07 09:56:04 +0300 |
commit | c1c5a5fd34402a4e9b0840a7b960c38371dd9748 (patch) | |
tree | 1c04413e2f2cc450c4be23ef459597b2b4e9f776 /src/org/traccar/protocol/ObdDongleProtocol.java | |
parent | e26d81c7430d8668b3af1bbf15672f06a855d6d0 (diff) | |
parent | dea7617218de2cbc7ebd930b4342aa35ffedcd8b (diff) | |
download | trackermap-server-c1c5a5fd34402a4e9b0840a7b960c38371dd9748.tar.gz trackermap-server-c1c5a5fd34402a4e9b0840a7b960c38371dd9748.tar.bz2 trackermap-server-c1c5a5fd34402a4e9b0840a7b960c38371dd9748.zip |
Merge remote-tracking branch 'refs/remotes/tananaev/master'
# Conflicts:
# web/app/view/LoginController.js
Diffstat (limited to 'src/org/traccar/protocol/ObdDongleProtocol.java')
-rw-r--r-- | src/org/traccar/protocol/ObdDongleProtocol.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/ObdDongleProtocol.java b/src/org/traccar/protocol/ObdDongleProtocol.java new file mode 100644 index 000000000..e87f9a99a --- /dev/null +++ b/src/org/traccar/protocol/ObdDongleProtocol.java @@ -0,0 +1,43 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * 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.frame.LengthFieldBasedFrameDecoder; +import org.traccar.BaseProtocol; +import org.traccar.TrackerServer; + +import java.util.List; + +public class ObdDongleProtocol extends BaseProtocol { + + public ObdDongleProtocol() { + super("obddongle"); + } + + @Override + public void initTrackerServers(List<TrackerServer> serverList) { + serverList.add(new TrackerServer(new ServerBootstrap(), this.getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1099, 20, 2, 3, 0)); + pipeline.addLast("objectDecoder", new ObdDongleProtocolDecoder(ObdDongleProtocol.this)); + } + }); + } + +} |