aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-09-19 11:08:23 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-09-19 11:08:23 +1200
commit25e4ce8cdc0b64dade5ddacc29d5d0cf28bebe64 (patch)
treec3bfef973d51b255055f5ccc99d6c0cd8b0b4789
parente6e6afd89be2f64488e61cd4c1391c898e8f6cc3 (diff)
downloadtrackermap-server-25e4ce8cdc0b64dade5ddacc29d5d0cf28bebe64.tar.gz
trackermap-server-25e4ce8cdc0b64dade5ddacc29d5d0cf28bebe64.tar.bz2
trackermap-server-25e4ce8cdc0b64dade5ddacc29d5d0cf28bebe64.zip
Fix a bug in GL200 decoder (fix #1410)
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/Gl200ProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index 38b1df1a6..23afa2c4c 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -140,7 +140,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
// Altitude
String altitude = parser.group(index++);
- if (speed != null) {
+ if (altitude != null) {
position.setAltitude(Double.valueOf(altitude));
}
diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java
index 1a816554f..2cbda8b7f 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(new Gl200Protocol());
+
+ verify(decoder.decode(null, null,
+ "+RESP:GTFRI,0F0106,862193020451183,,,10,1,1,0.0,163,,-57.513617,-25.368191,20150918182145,,,,,,21235.0,,,,0,210100,,,,20150918182149,00B8$"));
verify(decoder.decode(null, null,
"+RESP:GTOBD,1F0109,864251020135483,,gv500,0,78FFFF,,1,12613,,,,,,,,,,,,,,1286,0,0.0,0,17.1,3.379630,6.529701,20150813074639,0621,0030,51C0,A2B3,00,0.0,20150813074641,A7E6$"));