diff options
-rw-r--r-- | src/org/traccar/protocol/SuntechProtocolEncoder.java | 7 | ||||
-rw-r--r-- | test/org/traccar/protocol/TzoneProtocolDecoderTest.java | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/SuntechProtocolEncoder.java b/src/org/traccar/protocol/SuntechProtocolEncoder.java index 7bcb02088..2b5165995 100644 --- a/src/org/traccar/protocol/SuntechProtocolEncoder.java +++ b/src/org/traccar/protocol/SuntechProtocolEncoder.java @@ -15,12 +15,9 @@ */ package org.traccar.protocol; -import org.traccar.BaseProtocolEncoder; import org.traccar.StringProtocolEncoder; import org.traccar.model.Command; -import java.util.Map; - public class SuntechProtocolEncoder extends StringProtocolEncoder { @Override @@ -28,9 +25,9 @@ public class SuntechProtocolEncoder extends StringProtocolEncoder { switch (command.getType()) { case Command.TYPE_ENGINE_STOP: - return formatCommand(command, "CMD;{%s};02;Enable1\r", Command.KEY_UNIQUE_ID); + return formatCommand(command, "SA200CMD;{%s};02;Enable1\r", Command.KEY_UNIQUE_ID); case Command.TYPE_ENGINE_RESUME: - return formatCommand(command, "CMD;{%s};02;Disable1\n", Command.KEY_UNIQUE_ID); + return formatCommand(command, "SA200CMD;{%s};02;Disable1\r", Command.KEY_UNIQUE_ID); } return null; diff --git a/test/org/traccar/protocol/TzoneProtocolDecoderTest.java b/test/org/traccar/protocol/TzoneProtocolDecoderTest.java index 0d2c36bc7..3b24b1d13 100644 --- a/test/org/traccar/protocol/TzoneProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TzoneProtocolDecoderTest.java @@ -1,6 +1,8 @@ package org.traccar.protocol; import org.jboss.netty.buffer.ChannelBuffers; + +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import org.junit.Test; import org.traccar.helper.ChannelBufferTools; @@ -13,6 +15,9 @@ public class TzoneProtocolDecoderTest extends ProtocolDecoderTest { TzoneProtocolDecoder decoder = new TzoneProtocolDecoder(new TzoneProtocol()); + assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( + "545a00582424010b021e000008637710239476270f080b0a3228001600000000000000000000000000000000000000000000000401a00822001088c00020183701a6053800000000800000000000000000000000000000000077c9860d0a")))); + verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( "545A00912424010B021E000008661040203754350F061807083800160400CE5ADC041447620F0618070838000A0000060C7C0004253378370010AAC000000C37018504E500000000800000000000000000390B0A0014061113000000051200140610600014061220001000133800140610070010001473001000151100101500640010000920001000148400000000000000F2EF570D0A")))); |