diff options
-rw-r--r-- | src/org/traccar/protocol/OsmAndProtocolDecoder.java | 5 | ||||
-rw-r--r-- | test/org/traccar/protocol/OsmAndProtocolDecoderTest.java | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index c5884a4d0..eddfb592c 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -104,6 +104,11 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder { case "lon": position.setLongitude(Double.parseDouble(value)); break; + case "location": + String[] location = value.split(","); + position.setLatitude(Double.parseDouble(location[0])); + position.setLongitude(Double.parseDouble(location[1])); + break; case "speed": position.setSpeed(Double.parseDouble(value)); break; diff --git a/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java b/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java index 6ec885058..1dc89b251 100644 --- a/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java +++ b/test/org/traccar/protocol/OsmAndProtocolDecoderTest.java @@ -34,6 +34,9 @@ public class OsmAndProtocolDecoderTest extends ProtocolTest { verifyPosition(decoder, request( "/?id=861001000719969&lat=41.666667&lon=-0.883333&altitude=350.059479&speed=0.000000&batt=87")); + verifyPosition(decoder, request( + "/?id=123456×tamp=1377177267&location=60.0,30.0")); + } } |