diff options
-rw-r--r-- | src/org/traccar/protocol/Xrb28ProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/Xrb28ProtocolDecoderTest.java | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Xrb28ProtocolDecoder.java b/src/org/traccar/protocol/Xrb28ProtocolDecoder.java index a50716abb..eb72dcd1b 100644 --- a/src/org/traccar/protocol/Xrb28ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xrb28ProtocolDecoder.java @@ -57,7 +57,7 @@ public class Xrb28ProtocolDecoder extends BaseProtocolDecoder { .number("(d+),") // satellites .number("(d+.d+),") // hdop .number("(dd)(dd)(dd),") // date (ddmmyy) - .number("(-?d+),") // altitude + .number("(-?d+.?d*),") // altitude .expression(".,") // height unit .expression(".#") // mode .compile(); @@ -109,7 +109,7 @@ public class Xrb28ProtocolDecoder extends BaseProtocolDecoder { dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); - position.setAltitude(parser.nextInt()); + position.setAltitude(parser.nextDouble()); return position; } diff --git a/test/org/traccar/protocol/Xrb28ProtocolDecoderTest.java b/test/org/traccar/protocol/Xrb28ProtocolDecoderTest.java index eaa28906e..0eea02de7 100644 --- a/test/org/traccar/protocol/Xrb28ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Xrb28ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class Xrb28ProtocolDecoderTest extends ProtocolTest { Xrb28ProtocolDecoder decoder = new Xrb28ProtocolDecoder(null); + verifyPosition(decoder, text( + "*SCOR,OM,867584030387299,D0,0,012102.00,A,0608.00062,S,10659.70331,E,12,0.69,151118,30.3,M,A#")); + verifyNull(decoder, text( "*SCOR,OM,863158022988725,H0,0,412,28,80,0#")); |