diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-25 09:47:04 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-25 09:47:04 +1200 |
commit | 6feff5849f6dca3c94cf03e16e972ae85599e5bc (patch) | |
tree | 5922ff4bfbb10564e746c4044577098ec9020da2 | |
parent | bfe1227df5892e7542d80559363833c302a02077 (diff) | |
download | trackermap-server-6feff5849f6dca3c94cf03e16e972ae85599e5bc.tar.gz trackermap-server-6feff5849f6dca3c94cf03e16e972ae85599e5bc.tar.bz2 trackermap-server-6feff5849f6dca3c94cf03e16e972ae85599e5bc.zip |
Fix GL200 speed value issue
-rw-r--r-- | src/org/traccar/protocol/Gl200ProtocolDecoder.java | 3 | ||||
-rw-r--r-- | test/org/traccar/protocol/Gl200ProtocolDecoderTest.java | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 9383f2d4e..1392c56a8 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -26,6 +26,7 @@ import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.Context; +import org.traccar.helper.UnitsConverter; import org.traccar.model.Event; import org.traccar.model.Position; @@ -104,7 +105,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { // Speed String speed = parser.group(index++); if (speed != null) { - position.setSpeed(Double.valueOf(speed)); + position.setSpeed(UnitsConverter.knotsFromKph(Double.valueOf(speed))); } // Course diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index 0c6501c64..bbb0fb37a 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class Gl200ProtocolDecoderTest extends ProtocolDecoderTest { public void testDecode() throws Exception { Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(null); + + verify(decoder.decode(null, null, null, + "+RESP:GTFRI,1A0401,860599000508846,,0,0,1,1,134.8,154,278.7,-76.671089,39.778885,20150623154301,0310,0260,043F,7761,,99,20150623154314,0F24$")); verify(decoder.decode(null, null, null, "+RESP:GTFRI,1A0200,860599000165464,CRI001,0,0,1,2,,41,,-71.153137,42.301634,20150328020301,,,,,280.3,55,20150327220351,320C")); |