aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-05-07 10:13:15 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-05-07 10:13:15 +1200
commit6fd8c11fde3ff6d0c0f959111ff505d50607ae74 (patch)
treea75901984b65f195f580da00d07b232d72cc6df6
parentb09f40b3ce5bcfee00e04abfc04b315aa1fbbb5d (diff)
downloadtraccar-server-6fd8c11fde3ff6d0c0f959111ff505d50607ae74.tar.gz
traccar-server-6fd8c11fde3ff6d0c0f959111ff505d50607ae74.tar.bz2
traccar-server-6fd8c11fde3ff6d0c0f959111ff505d50607ae74.zip
Add Tytan status flags
-rw-r--r--src/org/traccar/protocol/TytanProtocolDecoder.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/TytanProtocolDecoder.java b/src/org/traccar/protocol/TytanProtocolDecoder.java
index 6ccce4423..5e48c2813 100644
--- a/src/org/traccar/protocol/TytanProtocolDecoder.java
+++ b/src/org/traccar/protocol/TytanProtocolDecoder.java
@@ -82,8 +82,10 @@ public class TytanProtocolDecoder extends BaseProtocolDecoder {
lon = lon * 360 / 16777216 - 180;
position.setLongitude(lon);
- // Course
- int course = (buf.readUnsignedByte() >> 5) * 45;
+ // Status
+ flags = buf.readUnsignedByte();
+ position.set(Event.KEY_STATUS, flags & 0x1f);
+ int course = (flags >> 5) * 45;
course = (course + 180) % 360;
position.setCourse(course);