From 059e040546df731827a455cefd5b293c3b14694c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 15 Sep 2015 18:49:35 +1200 Subject: Update GT06 commands format --- src/org/traccar/protocol/Gt06ProtocolEncoder.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/org/traccar') 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; -- cgit v1.2.3