aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-11 10:24:07 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-11 10:24:07 +1200
commit1f2c8ab848ac2b9d80440d8cdad8c1c293088bae (patch)
treee5a0c4a84b7a614ef8039c78347568edaf19be59 /src
parent662b552ba75c874ca1f1d67310f7004eb5da1991 (diff)
downloadtraccar-server-1f2c8ab848ac2b9d80440d8cdad8c1c293088bae.tar.gz
traccar-server-1f2c8ab848ac2b9d80440d8cdad8c1c293088bae.tar.bz2
traccar-server-1f2c8ab848ac2b9d80440d8cdad8c1c293088bae.zip
Add more CalAmp unit tests
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/CalAmpProtocolDecoder.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/CalAmpProtocolDecoder.java b/src/org/traccar/protocol/CalAmpProtocolDecoder.java
index 7850de1ca..c89983c23 100644
--- a/src/org/traccar/protocol/CalAmpProtocolDecoder.java
+++ b/src/org/traccar/protocol/CalAmpProtocolDecoder.java
@@ -212,13 +212,15 @@ public class CalAmpProtocolDecoder extends BaseProtocolDecoder {
// Event code and status
if (type == MSG_EVENT_REPORT || type == MSG_MINI_EVENT_REPORT) {
- extendedInfo.set("event", buf.readUnsignedByte());
+ extendedInfo.set("event", buf.readUnsignedByte() + " - " + buf.readUnsignedByte());
}
// Accumulators
- /*int accCount = buf.readUnsignedByte();
+ int accCount = buf.readUnsignedByte();
int accType = accCount >> 6;
accCount &= 0x3f;
+
+ buf.readUnsignedByte(); // reserved
if (accType == 1) {
buf.readUnsignedInt(); // threshold
@@ -227,7 +229,7 @@ public class CalAmpProtocolDecoder extends BaseProtocolDecoder {
for (int i = 0; i < accCount; i++) {
extendedInfo.set("acc" + i, buf.readUnsignedInt());
- }*/
+ }
position.setExtendedInfo(extendedInfo.toString());
return position;