From fcdea01510dc9bf7144c76f4dd3a08c8c4eebaca Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 24 Nov 2015 22:58:06 +1300 Subject: Fix Ulbotech event data decoding --- src/org/traccar/protocol/UlbotechProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/protocol/UlbotechProtocolDecoder.java b/src/org/traccar/protocol/UlbotechProtocolDecoder.java index 5d882ffd8..dd6fb1593 100644 --- a/src/org/traccar/protocol/UlbotechProtocolDecoder.java +++ b/src/org/traccar/protocol/UlbotechProtocolDecoder.java @@ -204,7 +204,9 @@ public class UlbotechProtocolDecoder extends BaseProtocolDecoder { case DATA_EVENT: position.set(Event.KEY_EVENT, buf.readUnsignedByte()); - position.set("event-mask", buf.readUnsignedInt()); + if (length > 1) { + position.set("event-mask", buf.readUnsignedInt()); + } break; default: -- cgit v1.2.3