aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/AplicomProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/AplicomProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/AplicomProtocolDecoder.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java
index 03d7dbd6b..eb8d77011 100644
--- a/src/org/traccar/protocol/AplicomProtocolDecoder.java
+++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java
@@ -350,6 +350,19 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder {
if ((selector & 0x0800) != 0) {
position.set(Position.KEY_VIN, buf.readBytes(18).toString(StandardCharsets.US_ASCII).trim());
}
+
+ if ((selector & 0x10000) != 0) {
+ int count = buf.readUnsignedByte();
+ for (int i = 1; i <= count; i++) {
+ ChannelBuffer driver = buf.readBytes(22);
+ int endIndex = driver.indexOf(0, driver.writerIndex(), (byte) 0);
+ if (endIndex < 0) {
+ endIndex = driver.writerIndex();
+ }
+ position.set("driver" + i, driver.toString(0, endIndex, StandardCharsets.US_ASCII).trim());
+ position.set("driverTime" + i, buf.readUnsignedInt());
+ }
+ }
}
private void decodeH(Position position, ChannelBuffer buf, int selector) {