aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/EelinkProtocol.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-09-27 16:14:30 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-09-27 16:14:30 +1300
commit7b17e8d1fe1dc85b5a324776cbe87d1525230104 (patch)
tree9ff7b82f01658496692fb88e159ffb63901cbe6a /src/org/traccar/protocol/EelinkProtocol.java
parent7eb11d561176e99570396120802674cf67fbfd34 (diff)
downloadtrackermap-server-7b17e8d1fe1dc85b5a324776cbe87d1525230104.tar.gz
trackermap-server-7b17e8d1fe1dc85b5a324776cbe87d1525230104.tar.bz2
trackermap-server-7b17e8d1fe1dc85b5a324776cbe87d1525230104.zip
Implement eeLink protocol commands
Diffstat (limited to 'src/org/traccar/protocol/EelinkProtocol.java')
-rw-r--r--src/org/traccar/protocol/EelinkProtocol.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/EelinkProtocol.java b/src/org/traccar/protocol/EelinkProtocol.java
index 4da051159..e91fc5efd 100644
--- a/src/org/traccar/protocol/EelinkProtocol.java
+++ b/src/org/traccar/protocol/EelinkProtocol.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2015 - 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.
@@ -20,6 +20,7 @@ import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder;
import org.traccar.BaseProtocol;
import org.traccar.TrackerServer;
+import org.traccar.model.Command;
import java.util.List;
@@ -27,6 +28,11 @@ public class EelinkProtocol extends BaseProtocol {
public EelinkProtocol() {
super("eelink");
+ setSupportedCommands(
+ Command.TYPE_CUSTOM,
+ Command.TYPE_ENGINE_STOP,
+ Command.TYPE_ENGINE_RESUME,
+ Command.TYPE_REBOOT_DEVICE);
}
@Override
@@ -35,6 +41,7 @@ public class EelinkProtocol extends BaseProtocol {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 3, 2));
+ pipeline.addLast("objectEncoder", new EelinkProtocolEncoder());
pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(EelinkProtocol.this));
}
});