diff options
author | Anton Tananaev <anton@traccar.org> | 2023-02-21 09:56:03 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-02-21 09:56:03 -0800 |
commit | 392f00082faff72c9948ed569e4c883a5fabe7d6 (patch) | |
tree | 08b08d8654ba7321e5e7253b464002d4ec639b77 /src | |
parent | 754ff3a85baf2faaa1b962f16f52ebd0e12e6436 (diff) | |
download | trackermap-server-392f00082faff72c9948ed569e4c883a5fabe7d6.tar.gz trackermap-server-392f00082faff72c9948ed569e4c883a5fabe7d6.tar.bz2 trackermap-server-392f00082faff72c9948ed569e4c883a5fabe7d6.zip |
Support Meitrack K211G lock
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java | 6 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java index a7accf0f1..5c5ba4be4 100644 --- a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -420,6 +420,12 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { case 0x15: position.set(Position.KEY_INPUT, buf.readUnsignedByte()); break; + case 0x47: + int lockState = buf.readUnsignedByte(); + if (lockState > 0) { + position.set(Position.KEY_LOCK, lockState == 2); + } + break; case 0x97: position.set(Position.KEY_THROTTLE, buf.readUnsignedByte()); break; diff --git a/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java index 407d7a9b6..419eddf63 100644 --- a/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java @@ -11,6 +11,10 @@ public class MeitrackProtocolDecoderTest extends ProtocolTest { var decoder = inject(new MeitrackProtocolDecoder(null)); + verifyAttribute(decoder, binary( + "24245b3131342c3836343630363034343939333938372c4343452c0000000001005000130006012305000600070f1b004702060800000900000a00000b0000199d011a00000602d179570103b25ccc0604cf04862b0cc65b01000da4090d001c01000000010e0ccc010000b627be11000000002a41300d0a"), + Position.KEY_LOCK, true); + verifyAttribute(decoder, buffer( "$$u28,864606044993987,D82,0*D6"), Position.KEY_RESULT, "D82,0"); |