From 78f8d278276f0826eb302a08213609b083570760 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 10 Aug 2016 11:11:20 +0300 Subject: Workaround for CalAmp issue --- src/org/traccar/protocol/CalAmpProtocolDecoder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/protocol/CalAmpProtocolDecoder.java b/src/org/traccar/protocol/CalAmpProtocolDecoder.java index 99edb9fb7..47d7bf483 100644 --- a/src/org/traccar/protocol/CalAmpProtocolDecoder.java +++ b/src/org/traccar/protocol/CalAmpProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -130,7 +130,9 @@ public class CalAmpProtocolDecoder extends BaseProtocolDecoder { } for (int i = 0; i < accCount; i++) { - position.set("acc" + i, buf.readUnsignedInt()); + if (buf.readableBytes() >= 4) { + position.set("acc" + i, buf.readUnsignedInt()); + } } return position; -- cgit v1.2.3