diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-15 18:49:35 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-15 18:49:35 +1200 |
commit | 059e040546df731827a455cefd5b293c3b14694c (patch) | |
tree | 0f740c76eb2ccd9c31c7146c1063f1156d5f2c09 /src/org/traccar | |
parent | 24ed72ab26fd31769e334b928316b038b4d8b647 (diff) | |
download | traccar-server-059e040546df731827a455cefd5b293c3b14694c.tar.gz traccar-server-059e040546df731827a455cefd5b293c3b14694c.tar.bz2 traccar-server-059e040546df731827a455cefd5b293c3b14694c.zip |
Update GT06 commands format
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolEncoder.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolEncoder.java b/src/org/traccar/protocol/Gt06ProtocolEncoder.java index c96e49558..09773cc45 100644 --- a/src/org/traccar/protocol/Gt06ProtocolEncoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolEncoder.java @@ -18,7 +18,6 @@ package org.traccar.protocol; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.traccar.BaseProtocolEncoder; -import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Crc; import org.traccar.model.Command; @@ -39,13 +38,13 @@ public class Gt06ProtocolEncoder extends BaseProtocolEncoder { buf.writeInt(0); buf.writeBytes(content.getBytes()); // command - buf.writeShort(0); // message index + buf.writeShort(1); // message index buf.writeShort(Crc.crc16Ccitt(buf.toByteBuffer(2, buf.writerIndex() - 2))); buf.writeByte('\r'); buf.writeByte('\n'); - + return buf; } @@ -54,9 +53,9 @@ public class Gt06ProtocolEncoder extends BaseProtocolEncoder { switch (command.getType()) { case Command.TYPE_ENGINE_STOP: - return encodeContent("DYD,000000#"); + return encodeContent("DYD#"); case Command.TYPE_ENGINE_RESUME: - return encodeContent("HFYD,000000#"); + return encodeContent("HFYD#"); } return null; |