aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/TranSyncProtocol.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2023-05-18 07:32:25 -0700
committerGitHub <noreply@github.com>2023-05-18 07:32:25 -0700
commit22277c84db8b19fdda252aa21db3a2bf62d6cba2 (patch)
tree365b2ca300856126f9075a0379477b69b8eff1de /src/main/java/org/traccar/protocol/TranSyncProtocol.java
parentfbd3ee0d77673d94766a87aa67c05885e44aa7e5 (diff)
parent05a73b06f94e451239ebc61ebb2b8528705bbc61 (diff)
downloadtrackermap-server-22277c84db8b19fdda252aa21db3a2bf62d6cba2.tar.gz
trackermap-server-22277c84db8b19fdda252aa21db3a2bf62d6cba2.tar.bz2
trackermap-server-22277c84db8b19fdda252aa21db3a2bf62d6cba2.zip
Merge pull request #5085 from LiGuru/master
Add [Protocol]TranSyncProtocol - AIS 140
Diffstat (limited to 'src/main/java/org/traccar/protocol/TranSyncProtocol.java')
-rw-r--r--src/main/java/org/traccar/protocol/TranSyncProtocol.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/TranSyncProtocol.java b/src/main/java/org/traccar/protocol/TranSyncProtocol.java
new file mode 100644
index 000000000..5422380b6
--- /dev/null
+++ b/src/main/java/org/traccar/protocol/TranSyncProtocol.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2013 - 2023 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 org.traccar.config.Config;
+
+import javax.inject.Inject;
+
+public class TranSyncProtocol extends BaseProtocol {
+
+ @Inject
+ public TranSyncProtocol(Config config) {
+ addServer(new TrackerServer(config, getName(), false) {
+ @Override
+ protected void addProtocolHandlers(PipelineBuilder pipeline, Config config) {
+ pipeline.addLast(new LengthFieldBasedFrameDecoder(256, 2, 1, 2, 0, true));
+ pipeline.addLast(new TranSyncProtocolDecoder(TranSyncProtocol.this));
+ }
+ });
+ }
+}