aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-12-25 11:09:03 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2020-12-25 11:09:03 -0800
commitc69b4524fc003613bb70ef98fe99fd6b26277661 (patch)
tree101be331e5a4ae80a4cdb058b91bcf692bda63aa /src
parentfabe54f1e90a068ed2db756ec6fc5d724c705e45 (diff)
downloadtrackermap-server-c69b4524fc003613bb70ef98fe99fd6b26277661.tar.gz
trackermap-server-c69b4524fc003613bb70ef98fe99fd6b26277661.tar.bz2
trackermap-server-c69b4524fc003613bb70ef98fe99fd6b26277661.zip
Update BLE support
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java11
-rw-r--r--src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java3
2 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
index 5b04992ec..c38fd740d 100644
--- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
@@ -175,13 +175,10 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder {
}
break;
case 0x23:
- if (endIndex > buf.readerIndex()) {
- buf.skipBytes(6); // mac
- }
- if (endIndex > buf.readerIndex()) {
- position.setLatitude(buf.readIntLE() * 0.0000001);
- position.setLongitude(buf.readIntLE() * 0.0000001);
- }
+ position.set("tagId", ByteBufUtil.hexDump(buf.readSlice(6)));
+ position.setLatitude(buf.readIntLE() * 0.0000001);
+ position.setLongitude(buf.readIntLE() * 0.0000001);
+ hasLocation = true;
break;
case 0x24:
position.setTime(new Date(buf.readUnsignedIntLE() * 1000));
diff --git a/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java
index 6c8094b28..8f438b431 100644
--- a/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java
@@ -13,6 +13,9 @@ public class Minifinder2ProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, binary(
"ab10150076f1320003100133353534363530373130323933303602105a"));
+ verifyNotNull(decoder, binary(
+ "ab18480066b107010110013836383833323034373030373832350924a230e35f8200ea312b22bc7894b4b86956a31cbdb989fdb8b502ad2449ea60ab646eea0d5663c59c3dcf05549eb3b095754322df"));
+
verifyPositions(decoder, false, binary(
"ab180104c8d0400301100138363136323930353030303038393609243d3b3d4b0000065109249a3d3d4b0200e6504022ca603a7cf07c26c9c4f08159bf8cc448a73c3ec499c0ec0c4591e706bf94bf8087b878be943bb04351a3bd603a7cb4cae9b8d8150dfb98edb6943bb04353b0092486473d4b0210064d4722cec4f08159bf8ccc943bb04a2fa5c794bf8087b878c754a7033b6c57c60c8447c13e5dc5603a7cf07c26c248a73c3ec499c130fd652c9fadba04d3b5b7819cba40313cf75bfe0924f1ab3e4b0200064b2b22d5943bb04a2fa5ca94bf8087b878c7943bb04351a3c5d8150dfb98edba0c8447c13e5db9603a7cb4cae90924be95615f0101065116207bae800d0c1cf343000075006000020000000000000924799f615f0101064f162085af800d861bf343000085006a00030000000000000924c5e77e5f010106531620b8af800dd519f34300006c005d000200000000000009248ef77e5f11019e53162011af800da71bf343000056005d00020000000000000924f9017f5f0101b6531620a1b0800d8c1af343000020015700020000000000000924274e895f02104e531622d8862519239337d4286c074c2110b798ded0aa85e809247f50895f12105e631d22d5286c074c2110d2e0606614a079d0862519239337b798ded0aa85e809248d51895f02005e640902001002008d51895f0f22d6286c074c2110b498ded0aa85e809249551895f02105e640f22d6286c074c2110b498ded0aa85e809249f51895f021056640f22d6286c074c2110b498ded0aa85e80924a951895f02005e640f22d6286c074c2110b498ded0aa85e80924b351895f020056640f22d6286c074c2110b498ded0aa85e80924bd51895f020056640f22d6286c074c2110b498ded0aa85e80924c751895f020056640f22d6286c074c2110b498ded0aa85e80924d551895f020056641622d6e0606614a079c9862519239337bb98ded0aa85e80924db51895f020066641622d6e0606614a079c9862519239337bb98ded0aa85e80924e451895f02006e641622d6e0606614a079c9862519239337bb98ded0aa85e80924ee51895f020076641622d6e0606614a079c9862519239337bb98ded0aa85e80924f851895f120046631622d6e0606614a079c9862519239337bb98ded0aa85e809240252895f120046631622d6e0606614a079c9862519239337bb98ded0aa85e809240c52895f120046631622d6e0606614a079c9862519239337bb98ded0aa85e809241952895f120046630f22dc286c074c2110b798ded0aa85e809242352895f1101466316200a35411cb215460b0100f800c9000500000000000009242b52895f11013e631620fa34411cd315460b0000f800d1000400000000000009243552895f110146631620b734411c1017460b0000f800d20004000000000000"));