diff options
author | AuroraRAS <chplee@gmail.com> | 2021-05-02 01:36:22 +0800 |
---|---|---|
committer | AuroraRAS <chplee@gmail.com> | 2021-05-02 01:36:22 +0800 |
commit | 0d8f2af5ea9bafeec92a54d10b190165fa0b5d91 (patch) | |
tree | 3bec83b2112d12f93ce5ce992c433b7e0cf794fd /src/main/java/org/traccar/protocol/Mavlink2Protocol.java | |
parent | 7a4f3f22239cc9b3405387a29819654265e9b345 (diff) | |
download | trackermap-server-0d8f2af5ea9bafeec92a54d10b190165fa0b5d91.tar.gz trackermap-server-0d8f2af5ea9bafeec92a54d10b190165fa0b5d91.tar.bz2 trackermap-server-0d8f2af5ea9bafeec92a54d10b190165fa0b5d91.zip |
Add mavlink2 protocol support
Mavlink2 is a common protocol for unmanned vehicles and flight
controllers like Pixhawk devices.
Diffstat (limited to 'src/main/java/org/traccar/protocol/Mavlink2Protocol.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/Mavlink2Protocol.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Mavlink2Protocol.java b/src/main/java/org/traccar/protocol/Mavlink2Protocol.java new file mode 100644 index 000000000..ba051a854 --- /dev/null +++ b/src/main/java/org/traccar/protocol/Mavlink2Protocol.java @@ -0,0 +1,23 @@ +package org.traccar.protocol; + +import org.traccar.BaseProtocol; +import org.traccar.PipelineBuilder; +import org.traccar.TrackerServer; + +import io.netty.handler.codec.bytes.ByteArrayDecoder; +import io.netty.handler.codec.bytes.ByteArrayEncoder; + +public class Mavlink2Protocol extends BaseProtocol { + + public Mavlink2Protocol() { + addServer(new TrackerServer(true, getName()) { + @Override + protected void addProtocolHandlers(PipelineBuilder pipeline) { + pipeline.addLast(new ByteArrayEncoder()); + pipeline.addLast(new ByteArrayDecoder()); + pipeline.addLast(new Mavlink2ProtocolDecoder(Mavlink2Protocol.this)); + } + }); + } + +} |