aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorseym45 <seym45@gmail.com>2023-08-10 01:26:28 +0400
committerseym45 <seym45@gmail.com>2023-08-10 01:26:28 +0400
commit867404e9d7ffc6019d8d87dedc892aef1e70aec8 (patch)
treefef31c5a3ee762be2dac8f281798abe8bb469517 /src
parent5a9313a13dcf9a7c47f95086e56def99297405f9 (diff)
downloadtrackermap-server-867404e9d7ffc6019d8d87dedc892aef1e70aec8.tar.gz
trackermap-server-867404e9d7ffc6019d8d87dedc892aef1e70aec8.tar.bz2
trackermap-server-867404e9d7ffc6019d8d87dedc892aef1e70aec8.zip
Add gator commands to manage engine
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/GatorProtocolDecoder.java4
-rw-r--r--src/main/java/org/traccar/protocol/GatorProtocolEncoder.java4
2 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/GatorProtocolDecoder.java b/src/main/java/org/traccar/protocol/GatorProtocolDecoder.java
index f7da5dc75..a5ecb2169 100644
--- a/src/main/java/org/traccar/protocol/GatorProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/GatorProtocolDecoder.java
@@ -19,7 +19,6 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
-import org.traccar.session.DeviceSession;
import org.traccar.NetworkMessage;
import org.traccar.Protocol;
import org.traccar.helper.BcdUtil;
@@ -27,6 +26,7 @@ import org.traccar.helper.Checksum;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.UnitsConverter;
import org.traccar.model.Position;
+import org.traccar.session.DeviceSession;
import java.net.SocketAddress;
@@ -38,6 +38,8 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder {
public static final int MSG_HEARTBEAT = 0x21;
public static final int MSG_POSITION_REQUEST = 0x30;
+ public static final int MSG_RESTORES_THE_OIL_DUCT = 0x38;
+ public static final int MSG_CLOSE_THE_OIL_DUCT = 0x39;
public static final int MSG_POSITION_DATA = 0x80;
public static final int MSG_ROLLCALL_RESPONSE = 0x81;
public static final int MSG_ALARM_DATA = 0x82;
diff --git a/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java b/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
index 3d38b7455..6d96c6e9a 100644
--- a/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
@@ -69,6 +69,10 @@ public class GatorProtocolEncoder extends BaseProtocolEncoder {
switch (command.getType()) {
case Command.TYPE_POSITION_SINGLE:
return encodeContent(command.getDeviceId(), GatorProtocolDecoder.MSG_POSITION_REQUEST);
+ case Command.TYPE_ENGINE_STOP:
+ return encodeContent(command.getDeviceId(), GatorProtocolDecoder.MSG_CLOSE_THE_OIL_DUCT);
+ case Command.TYPE_ENGINE_RESUME:
+ return encodeContent(command.getDeviceId(), GatorProtocolDecoder.MSG_RESTORES_THE_OIL_DUCT);
default:
return null;
}