diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-17 18:11:09 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-17 18:11:09 -0700 |
commit | 433816109a02622145ff5ead295d3aff5bafaacd (patch) | |
tree | dc3eb4c61d2468b156c653dd0f8c7b3e8cdc4c4f | |
parent | dcdbbf298e91e04c36c0310ac9c3314000d8781f (diff) | |
download | trackermap-server-433816109a02622145ff5ead295d3aff5bafaacd.tar.gz trackermap-server-433816109a02622145ff5ead295d3aff5bafaacd.tar.bz2 trackermap-server-433816109a02622145ff5ead295d3aff5bafaacd.zip |
Decode Minifinder pet activity
-rw-r--r-- | src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java | 10 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java index 641a45864..c63226c80 100644 --- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 - 2021 Anton Tananaev (anton@traccar.org) + * Copyright 2019 - 2022 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -263,6 +263,14 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedInt(); // timestamp position.set(Position.KEY_STEPS, buf.readUnsignedInt()); break; + case 0x31: + int i = 1; + while (buf.readerIndex() < endIndex) { + position.set("activity" + i + "Time", buf.readUnsignedInt()); + position.set("activity" + i, buf.readUnsignedInt()); + i += 1; + } + break; case 0x40: buf.readUnsignedIntLE(); // timestamp int heartRate = buf.readUnsignedByte(); diff --git a/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java index ab23f277a..1813a5370 100644 --- a/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class Minifinder2ProtocolDecoderTest extends ProtocolTest { var decoder = new Minifinder2ProtocolDecoder(null); verifyPositions(decoder, binary( + "AB103D0035A700000110013836373733303035333430333237390924AC5783620103C250162030CC5F0D5002FB432D00AF005A3158006D0A00000B0931EC5783620A000000")); + + verifyPositions(decoder, binary( "ab10350015ae59010110013836333932313033333836353231360924723a12610042535a182ac0f6b4f2923100c900af02215c2b9bfb5461736b4c4d53")); verifyNull(decoder, binary( |