aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java3
-rw-r--r--test/org/traccar/protocol/Gl200ProtocolDecoderTest.java3
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"));