diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-08-11 20:45:47 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-08-11 20:45:47 -0700 |
commit | eac5f4889b4eadcd2878716be9b33224bde57d4a (patch) | |
tree | 8adcf597151b4628754c1d3f390b0193edf9320b | |
parent | ea39e1d4c8ba7fe8e2a017ec064b3bcb90f2e1d8 (diff) | |
download | traccar-server-eac5f4889b4eadcd2878716be9b33224bde57d4a.tar.gz traccar-server-eac5f4889b4eadcd2878716be9b33224bde57d4a.tar.bz2 traccar-server-eac5f4889b4eadcd2878716be9b33224bde57d4a.zip |
Decode home WiFi network
-rw-r--r-- | src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java | 9 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java index d20e18556..059041d6b 100644 --- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java @@ -242,6 +242,15 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder { endIndex - buf.readerIndex(), StandardCharsets.US_ASCII).toString()); } break; + case 0x2A: + buf.readUnsignedByte(); // flags + buf.skipBytes(6); // mac + buf.readUnsignedByte(); // rssi + position.setLatitude(buf.readIntLE() * 0.0000001); + position.setLongitude(buf.readIntLE() * 0.0000001); + position.setValid(true); + hasLocation = true; + break; case 0x30: buf.readUnsignedInt(); // timestamp position.set(Position.KEY_STEPS, buf.readUnsignedInt()); diff --git a/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java index 1be1e347a..ab23f277a 100644 --- a/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/Minifinder2ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class Minifinder2ProtocolDecoderTest extends ProtocolTest { var decoder = new Minifinder2ProtocolDecoder(null); + verifyPositions(decoder, binary( + "ab10350015ae59010110013836333932313033333836353231360924723a12610042535a182ac0f6b4f2923100c900af02215c2b9bfb5461736b4c4d53")); + verifyNull(decoder, binary( "ab10150076f1320003100133353534363530373130323933303602105a")); |