aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-04-29 23:03:09 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-04-29 23:03:09 -0700
commit97d471f2bed2d2a5a59d20c24c1594fa3c55d760 (patch)
treee4e954f9955cedd41aa3245317528a4ec791c3f4
parent74d366e3dc82e1a5854efd905b6a72201dbde89c (diff)
downloadtrackermap-server-97d471f2bed2d2a5a59d20c24c1594fa3c55d760.tar.gz
trackermap-server-97d471f2bed2d2a5a59d20c24c1594fa3c55d760.tar.bz2
trackermap-server-97d471f2bed2d2a5a59d20c24c1594fa3c55d760.zip
Fix coordinates decoding
-rw-r--r--src/main/java/org/traccar/protocol/GlobalstarProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/GlobalstarProtocolDecoderTest.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/GlobalstarProtocolDecoder.java b/src/main/java/org/traccar/protocol/GlobalstarProtocolDecoder.java
index ab9e5dccf..5739a1224 100644
--- a/src/main/java/org/traccar/protocol/GlobalstarProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/GlobalstarProtocolDecoder.java
@@ -99,7 +99,7 @@ public class GlobalstarProtocolDecoder extends BaseHttpProtocolDecoder {
position.setLatitude(position.getLatitude() - 180);
}
- position.setLongitude(buf.readUnsignedMedium() * 90.0 / (1 << 23));
+ position.setLongitude(buf.readUnsignedMedium() * 180.0 / (1 << 23));
if (position.getLongitude() > 180) {
position.setLongitude(position.getLongitude() - 360);
}
diff --git a/src/test/java/org/traccar/protocol/GlobalstarProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/GlobalstarProtocolDecoderTest.java
index 625d697d7..f9ea95a4f 100644
--- a/src/test/java/org/traccar/protocol/GlobalstarProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/GlobalstarProtocolDecoderTest.java
@@ -18,7 +18,7 @@ public class GlobalstarProtocolDecoderTest extends ProtocolTest {
"<esn>0-2654816</esn>",
"<unixTime>1550440592</unixTime>",
"<gps>N</gps>",
- "<payload length=\"9\" source=\"pc\" encoding=\"hex\">0x00337BA319B7280A00</payload>",
+ "<payload length=\"9\" source=\"pc\" encoding=\"hex\">0x00337BA619B7250A00</payload>",
"</stuMessage>",
"</stuMessages>")));