diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-01-13 22:06:03 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-01-13 22:06:03 +1300 |
commit | 59b108d8e06e5ee54087d43ec08bf4744cb58680 (patch) | |
tree | 9ef22663a4ab19dfe88724918f22e910e20a729f /src/org/traccar/protocol | |
parent | 0b0236a81c9c3579293f342810867da31ee2a7a2 (diff) | |
download | traccar-server-59b108d8e06e5ee54087d43ec08bf4744cb58680.tar.gz traccar-server-59b108d8e06e5ee54087d43ec08bf4744cb58680.tar.bz2 traccar-server-59b108d8e06e5ee54087d43ec08bf4744cb58680.zip |
Implement Meiligao output control commands
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/MeiligaoProtocol.java | 2 | ||||
-rw-r--r-- | src/org/traccar/protocol/MeiligaoProtocolEncoder.java | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocol.java b/src/org/traccar/protocol/MeiligaoProtocol.java index 39d871b33..05dd8834b 100644 --- a/src/org/traccar/protocol/MeiligaoProtocol.java +++ b/src/org/traccar/protocol/MeiligaoProtocol.java @@ -30,6 +30,8 @@ public class MeiligaoProtocol extends BaseProtocol { setSupportedCommands( Command.TYPE_POSITION_SINGLE, Command.TYPE_POSITION_PERIODIC, + Command.TYPE_ENGINE_STOP, + Command.TYPE_ENGINE_RESUME, Command.TYPE_MOVEMENT_ALARM, Command.TYPE_SET_TIMEZONE, Command.TYPE_REBOOT_DEVICE); diff --git a/src/org/traccar/protocol/MeiligaoProtocolEncoder.java b/src/org/traccar/protocol/MeiligaoProtocolEncoder.java index 84b9b642d..e8c62e502 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolEncoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolEncoder.java @@ -31,6 +31,7 @@ public class MeiligaoProtocolEncoder extends BaseProtocolEncoder { public static final int MSG_TRACK_ON_DEMAND = 0x4101; public static final int MSG_TRACK_BY_INTERVAL = 0x4102; public static final int MSG_MOVEMENT_ALARM = 0x4106; + public static final int MSG_OUTPUT_CONTROL = 0x4115; public static final int MSG_TIME_ZONE = 0x4132; public static final int MSG_REBOOT_GPS = 0x4902; @@ -69,6 +70,12 @@ public class MeiligaoProtocolEncoder extends BaseProtocolEncoder { case Command.TYPE_POSITION_PERIODIC: content.writeShort(((Number) attributes.get(Command.KEY_FREQUENCY)).intValue() / 10); return encodeContent(command.getDeviceId(), MSG_TRACK_BY_INTERVAL, content); + case Command.TYPE_ENGINE_STOP: + content.writeByte(0x00); + return encodeContent(command.getDeviceId(), MSG_OUTPUT_CONTROL, content); + case Command.TYPE_ENGINE_RESUME: + content.writeByte(0x01); + return encodeContent(command.getDeviceId(), MSG_OUTPUT_CONTROL, content); case Command.TYPE_MOVEMENT_ALARM: content.writeShort(((Number) attributes.get(Command.KEY_RADIUS)).intValue()); return encodeContent(command.getDeviceId(), MSG_MOVEMENT_ALARM, content); |