aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/AplicomProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-06-20 06:32:59 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-06-20 06:32:59 +1200
commit6f569b6d62b110c2679772c4a56122db6a614ed9 (patch)
tree7bb933ecbb8b3c31574b1ff2b9ddda0e8871f98b /src/org/traccar/protocol/AplicomProtocolDecoder.java
parent8ab0f580a24851454ec4a763d81363cc968c78a1 (diff)
downloadtrackermap-server-6f569b6d62b110c2679772c4a56122db6a614ed9.tar.gz
trackermap-server-6f569b6d62b110c2679772c4a56122db6a614ed9.tar.bz2
trackermap-server-6f569b6d62b110c2679772c4a56122db6a614ed9.zip
Support Aplicom E driver info
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) {