From 277a28cd11a60246de96bcfb7be75e177f483809 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 21 Sep 2016 05:11:01 +1200 Subject: Read event from OIGO messages --- src/org/traccar/protocol/OigoProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/OigoProtocolDecoder.java b/src/org/traccar/protocol/OigoProtocolDecoder.java index 799f47ea3..bbea38183 100644 --- a/src/org/traccar/protocol/OigoProtocolDecoder.java +++ b/src/org/traccar/protocol/OigoProtocolDecoder.java @@ -54,7 +54,7 @@ public class OigoProtocolDecoder extends BaseProtocolDecoder { DeviceSession deviceSession; switch (BitUtil.to(tag, 3)) { case 0: - String imei = ChannelBuffers.hexDump(buf.readBytes(9)).substring(1, 1 + 15); + String imei = ChannelBuffers.hexDump(buf.readBytes(8)).substring(1); deviceSession = getDeviceSession(channel, remoteAddress, imei); break; case 1: @@ -75,6 +75,8 @@ public class OigoProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); + position.set(Position.KEY_EVENT, buf.readUnsignedByte()); + int mask = buf.readInt(); if (BitUtil.check(mask, 0)) { -- cgit v1.2.3