aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/CastelProtocolDecoder.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java
index 09d314dae..bf82bede1 100644
--- a/src/org/traccar/protocol/CastelProtocolDecoder.java
+++ b/src/org/traccar/protocol/CastelProtocolDecoder.java
@@ -183,26 +183,26 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder {
sendResponse(channel, remoteAddress, version, id, MSG_CC_HEARTBEAT_RESPONSE, null);
- if (buf.readUnsignedByte() == 0x01) {
- int count = buf.readUnsignedByte();
- List<Position> positions = new LinkedList<>();
+ buf.readUnsignedByte(); // 0x01 for history
+ int count = buf.readUnsignedByte();
+
+ List<Position> positions = new LinkedList<>();
- for (int i = 0; i < count; i++) {
- Position position = readPosition(buf);
+ for (int i = 0; i < count; i++) {
+ Position position = readPosition(buf);
- position.set(Event.KEY_STATUS, buf.readUnsignedInt());
- position.set(Event.KEY_BATTERY, buf.readUnsignedByte());
- position.set(Event.KEY_ODOMETER, buf.readUnsignedInt());
+ position.set(Event.KEY_STATUS, buf.readUnsignedInt());
+ position.set(Event.KEY_BATTERY, buf.readUnsignedByte());
+ position.set(Event.KEY_ODOMETER, buf.readUnsignedInt());
- buf.readUnsignedByte(); // geo-fencing id
- buf.readUnsignedByte(); // geo-fencing flags
- buf.readUnsignedByte(); // additional flags
+ buf.readUnsignedByte(); // geo-fencing id
+ buf.readUnsignedByte(); // geo-fencing flags
+ buf.readUnsignedByte(); // additional flags
- position.set(Event.KEY_LAC, buf.readUnsignedShort());
- position.set(Event.KEY_CELL, buf.readUnsignedShort());
+ position.set(Event.KEY_LAC, buf.readUnsignedShort());
+ position.set(Event.KEY_CELL, buf.readUnsignedShort());
- positions.add(position);
- }
+ positions.add(position);
return positions;
}