aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-04-18 17:48:12 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-04-18 17:48:12 -0700
commit39c5734c2cfdb1ed92eb0801c73793c6603e394c (patch)
tree9f33885850015f5307d24fe8051e6f05a76e8e4d /src/main/java
parentbfe7df0681c09fd3f9ca325da881301955ba040e (diff)
downloadtrackermap-server-39c5734c2cfdb1ed92eb0801c73793c6603e394c.tar.gz
trackermap-server-39c5734c2cfdb1ed92eb0801c73793c6603e394c.tar.bz2
trackermap-server-39c5734c2cfdb1ed92eb0801c73793c6603e394c.zip
Support tag decoding
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/EelinkProtocolDecoder.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/EelinkProtocolDecoder.java b/src/main/java/org/traccar/protocol/EelinkProtocolDecoder.java
index 41d76f37f..c3fe7121e 100644
--- a/src/main/java/org/traccar/protocol/EelinkProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/EelinkProtocolDecoder.java
@@ -271,6 +271,22 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.PREFIX_TEMP + 2, buf.readShort() / 16.0);
}
+ if (buf.readableBytes() >= 2) {
+ int count = buf.readUnsignedByte();
+ buf.readUnsignedByte(); // id
+ for (int i = 1; i <= count; i++) {
+ position.set("tag" + i + "Id", ByteBufUtil.hexDump(buf.readSlice(6)));
+ buf.readUnsignedByte(); // signal level
+ buf.readUnsignedByte(); // reserved
+ buf.readUnsignedByte(); // model
+ buf.readUnsignedByte(); // version
+ position.set("tag" + i + "Battery", buf.readUnsignedShort() * 0.001);
+ position.set("tag" + i + "Temp", buf.readShort() / 256.0);
+ position.set("tag" + i + "Data", buf.readUnsignedShort());
+ }
+
+ }
+
}
return position;