aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-01-30 20:41:43 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-01-30 20:41:43 -0800
commit2b2fef08daaa7950a4911aef184f4dca56500da1 (patch)
tree0ee96a313310fcdae2e6fed4d7bfb7bc20166c3b
parentccbb2893352ef62c95be6f1968214e4a6fa1a08d (diff)
downloadtraccar-server-2b2fef08daaa7950a4911aef184f4dca56500da1.tar.gz
traccar-server-2b2fef08daaa7950a4911aef184f4dca56500da1.tar.bz2
traccar-server-2b2fef08daaa7950a4911aef184f4dca56500da1.zip
Fix speed decoding
-rw-r--r--src/org/traccar/protocol/SatsolProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/SatsolProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/SatsolProtocolDecoder.java b/src/org/traccar/protocol/SatsolProtocolDecoder.java
index 77d292d92..c457d5620 100644
--- a/src/org/traccar/protocol/SatsolProtocolDecoder.java
+++ b/src/org/traccar/protocol/SatsolProtocolDecoder.java
@@ -69,7 +69,7 @@ public class SatsolProtocolDecoder extends BaseProtocolDecoder {
position.setTime(new Date(buf.readUnsignedIntLE() * 1000));
position.setLatitude(buf.readUnsignedIntLE() * 0.000001);
position.setLongitude(buf.readUnsignedIntLE() * 0.000001);
- position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShortLE()));
+ position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShortLE() * 0.01));
position.setAltitude(buf.readShortLE());
position.setCourse(buf.readUnsignedShortLE());
position.setValid(buf.readUnsignedByte() > 0);
diff --git a/test/org/traccar/protocol/SatsolProtocolDecoderTest.java b/test/org/traccar/protocol/SatsolProtocolDecoderTest.java
index acdb5a084..45e919bbb 100644
--- a/test/org/traccar/protocol/SatsolProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/SatsolProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class SatsolProtocolDecoderTest extends ProtocolTest {
SatsolProtocolDecoder decoder = new SatsolProtocolDecoder(null);
verifyPositions(decoder, binary(
+ "f0e1bf4cb2ec1600e1005f8791e901000000c959515c2cc24a03aeadcd010e01a800250001090201878e92e901000000cb59515c2dc24a03b8adcd018801a8001d0001080201325993e901000000cc59515c2fc24a03bfadcd01ab01a800220001080201dd8194e901000000cd59515c32c24a03ceadcd015801a8002500010802015f3795e905000900ce59515c32c24a03d8adcd01f600a700250001091401000000000000000000863496e901000000cf59515c34c24a03ddadcd019b00a700280001090201714197e904000600cf59515c34c24a03ddadcd019b00a7002800010a1401becd07001901"));
+
+ verifyPositions(decoder, binary(
"22b5bf4cb2ec1600500122b37ba020001500cb5d2f5c68c24a0310aecd016200b1003d000004000177042700a501000000000000000101020100011e00a1657ca020001500cf5d2f5c68c24a03dbadcd013501b10097000004030177042700a501000000000000000101020101011e00816e7da003004800b95e2f5c89c24a03fbadcd010000aa00000000040601011038363133353930333632333039323600383933373530323730313030323335343836363000323537303237303132333534383636004d5453000000000066640101005700e515cf047ea001000000295f2f5c89c24a03fbadcd0100009a0000000106020106dc30a8030048006bc13e5c19c24a03bfadcd010000ad00000000050600011338363133353930333632333039323600383933373530323730313030323335343836363000323537303237303132333534383636004d5453000000000066640101005700e515"));
}