From 39c5734c2cfdb1ed92eb0801c73793c6603e394c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 18 Apr 2020 17:48:12 -0700 Subject: Support tag decoding --- .../java/org/traccar/protocol/EelinkProtocolDecoder.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main/java/org/traccar/protocol') 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; -- cgit v1.2.3