From 6fd8c11fde3ff6d0c0f959111ff505d50607ae74 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 7 May 2015 10:13:15 +1200 Subject: Add Tytan status flags --- src/org/traccar/protocol/TytanProtocolDecoder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/org/traccar/protocol') 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); -- cgit v1.2.3