aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-08-10 11:11:20 +0300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-08-10 11:11:29 +0300
commit78f8d278276f0826eb302a08213609b083570760 (patch)
tree8e14160463c956e7f0ac260d7c72d85680c77d92 /src
parent21641679ddc92ad3f51ae6e84409c9186e668bbc (diff)
downloadtraccar-server-78f8d278276f0826eb302a08213609b083570760.tar.gz
traccar-server-78f8d278276f0826eb302a08213609b083570760.tar.bz2
traccar-server-78f8d278276f0826eb302a08213609b083570760.zip
Workaround for CalAmp issue
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/CalAmpProtocolDecoder.java6
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;