diff options
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/protocol/EelinkProtocolDecoder.java | 16 |
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; |