diff options
author | Anton Tananaev <anton@traccar.org> | 2023-03-10 07:34:15 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-03-10 07:34:15 -0800 |
commit | f4d10160d9513eb190169d0ab335c3d99c6d4e31 (patch) | |
tree | 5ba05b4e8b8baaa478f9aabb9a69f6cf255ca5d8 | |
parent | 2749e520c9ea1ba778c120739e2b67a9fe5e119c (diff) | |
download | trackermap-server-f4d10160d9513eb190169d0ab335c3d99c6d4e31.tar.gz trackermap-server-f4d10160d9513eb190169d0ab335c3d99c6d4e31.tar.bz2 trackermap-server-f4d10160d9513eb190169d0ab335c3d99c6d4e31.zip |
Decode bark count
-rw-r--r-- | src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java | 4 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java index 0b08badb8..aa43a6054 100644 --- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java @@ -277,6 +277,10 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder { i += 1; } break; + case 0x37: + buf.readUnsignedIntLE(); // timestamp + position.set("barkCount", BitUtil.to(buf.readUnsignedIntLE(), 31)); + 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 2013fa820..693a11fc5 100644 --- a/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java @@ -11,6 +11,10 @@ public class Minifinder2ProtocolDecoderTest extends ProtocolTest { var decoder = inject(new Minifinder2ProtocolDecoder(null)); verifyAttribute(decoder, binary( + "ab101c00d6f61e000110013836333932313033393939363038300937efd201640c000000"), + "barkCount", 12L); + + verifyAttribute(decoder, binary( "ab102600080f1400011001383633393231303339393833343736092429b347633003a96409020000008027b34763"), "bark", true); |