diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-08-10 11:11:20 +0300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-08-10 11:11:29 +0300 |
commit | 78f8d278276f0826eb302a08213609b083570760 (patch) | |
tree | 8e14160463c956e7f0ac260d7c72d85680c77d92 /src | |
parent | 21641679ddc92ad3f51ae6e84409c9186e668bbc (diff) | |
download | trackermap-server-78f8d278276f0826eb302a08213609b083570760.tar.gz trackermap-server-78f8d278276f0826eb302a08213609b083570760.tar.bz2 trackermap-server-78f8d278276f0826eb302a08213609b083570760.zip |
Workaround for CalAmp issue
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/CalAmpProtocolDecoder.java | 6 |
1 files changed, 4 insertions, 2 deletions
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; |