diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-12-29 20:47:41 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-12-29 20:47:41 -0800 |
commit | 407147946a7c1a49242a78227351605c2ece9e32 (patch) | |
tree | 2b460e881579e41da6c1a6551cddaf236011c450 /src | |
parent | 790db6295f130e64c8346f13985dd0c15f938b40 (diff) | |
download | trackermap-server-407147946a7c1a49242a78227351605c2ece9e32.tar.gz trackermap-server-407147946a7c1a49242a78227351605c2ece9e32.tar.bz2 trackermap-server-407147946a7c1a49242a78227351605c2ece9e32.zip |
Decode additional attributes
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java | 11 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java index 0eb6f8776..4a1324840 100644 --- a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -424,6 +424,14 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { case 0x07: position.set(Position.KEY_RSSI, buf.readUnsignedByte()); break; + case 0x14: + position.set(Position.KEY_OUTPUT, buf.readUnsignedByte()); + break; + case 0x15: + int input = buf.readUnsignedByte(); + position.set(Position.KEY_IGNITION, BitUtil.check(input, 2)); + position.set(Position.KEY_INPUT, input); + break; case 0x97: position.set(Position.KEY_THROTTLE, buf.readUnsignedByte()); break; @@ -452,6 +460,9 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { case 0x0B: position.setAltitude(buf.readShortLE()); break; + case 0x16: + position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShortLE() * 0.01); + break; case 0x19: position.set(Position.KEY_BATTERY, buf.readUnsignedShortLE() * 0.01); break; diff --git a/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java index 58861c139..1c90468bd 100644 --- a/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class MeitrackProtocolDecoderTest extends ProtocolTest { var decoder = new MeitrackProtocolDecoder(null); + verifyPositions(decoder, binary( + "2424423233392c3836323039303035303030373436352c4343452c0100000003004300130006050006000700140015801b00080800000900000a00000b0000165105198d011a630540160005024c5e910103590bfe0204922153290c6b2501000dd5b50200004300130006050006000700140015011b00080800000900000a00000b0000165005198d011a630540010005024c5e910103590bfe0204932153290c6b2501000dd6b50200004300130006050006000700140015011b00080800000900000a00000b0000165205198d011a630540230005024c5e910103590bfe0204942153290c6b2501000dd7b50200002a43330d0a")); + verifyPosition(decoder, buffer( "$$D149,867047043162018,AAA,35,-1.264865,36.800705,211001105240,A,9,20,41.0,323,1,1697,1,0,000|00||,0000,4.33|12.96|1.92|2.72|2.69,0.000000|0|0.000000,*E1")); |