diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-30 23:03:26 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-30 23:03:26 +1300 |
commit | 161875aaccca9799fb0e79948781547930664158 (patch) | |
tree | ec0731e264ddcde459a2361dd407a401743195d6 | |
parent | f757f587aca7491d27f2f536cf402de8cbee1d1e (diff) | |
download | trackermap-server-161875aaccca9799fb0e79948781547930664158.tar.gz trackermap-server-161875aaccca9799fb0e79948781547930664158.tar.bz2 trackermap-server-161875aaccca9799fb0e79948781547930664158.zip |
Attempt to fix GT06 commands
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolEncoder.java | 6 | ||||
-rw-r--r-- | test/org/traccar/protocol/Gt06ProtocolEncoderTest.java | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolEncoder.java b/src/org/traccar/protocol/Gt06ProtocolEncoder.java index 82c689d9e..b879163d2 100644 --- a/src/org/traccar/protocol/Gt06ProtocolEncoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolEncoder.java @@ -38,7 +38,7 @@ public class Gt06ProtocolEncoder extends BaseProtocolEncoder { buf.writeInt(0); buf.writeBytes(content.getBytes()); // command - buf.writeShort(1); // message index + buf.writeShort(0); // message index buf.writeShort(Crc.crc16Ccitt(buf.toByteBuffer(2, buf.writerIndex() - 2))); @@ -53,9 +53,9 @@ public class Gt06ProtocolEncoder extends BaseProtocolEncoder { switch (command.getType()) { case Command.TYPE_ENGINE_STOP: - return encodeContent("DYD#"); + return encodeContent("RELAY,1#"); case Command.TYPE_ENGINE_RESUME: - return encodeContent("HFYD#"); + return encodeContent("RELAY,0#"); } return null; diff --git a/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java b/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java index 586fb0859..2eadb2e20 100644 --- a/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java @@ -18,7 +18,7 @@ public class Gt06ProtocolEncoderTest { command.setType(Command.TYPE_ENGINE_STOP); Assert.assertEquals(encoder.encodeCommand(command), ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( - "78780e800800000000445944230001d09e0d0a"))); + "787812800c0000000052454c41592c312300001c300d0a"))); } |