aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-01-10 07:48:06 -0800
committerAnton Tananaev <anton@traccar.org>2023-01-10 07:48:06 -0800
commit397d959f7dc61d9df241e589910ff4e15d5145d8 (patch)
tree18a150ded7c728b5873a0849328ae68e21a21a17
parent27a9aabcff99582bab762890ea0c6d4395a532aa (diff)
downloadtrackermap-server-397d959f7dc61d9df241e589910ff4e15d5145d8.tar.gz
trackermap-server-397d959f7dc61d9df241e589910ff4e15d5145d8.tar.bz2
trackermap-server-397d959f7dc61d9df241e589910ff4e15d5145d8.zip
Decode MD500S temperature
-rw-r--r--src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java10
-rw-r--r--src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java
index 82c8f0087..bf8ceaf8a 100644
--- a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java
@@ -528,6 +528,16 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
int id = extension ? buf.readUnsignedShort() : buf.readUnsignedByte();
int length = buf.readUnsignedByte();
switch (id) {
+ case 0x2A:
+ case 0x2B:
+ case 0x2C:
+ case 0x2D:
+ case 0x2E:
+ case 0x2F:
+ case 0x30:
+ case 0x31:
+ position.set(Position.PREFIX_TEMP + buf.readUnsignedByte(), buf.readShortLE() * 0.01);
+ break;
case 0xFE31:
buf.readUnsignedByte(); // alarm protocol
buf.readUnsignedByte(); // alarm type
diff --git a/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java
index 67b83ebd9..ce0a1e922 100644
--- a/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java
@@ -12,6 +12,9 @@ public class MeitrackProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new MeitrackProtocolDecoder(null));
verifyPositions(decoder, binary(
+ "24246a3138312c3836343238313034313930383330332c4343452c00000000010093001f000505000600070714001502090800000900000a00000b0000160a001706001904001ad90440230006023279570103305ccc0604f536492b0c510300000d495701001c014000000b0e0ccc010000922781abb90c00002a030034212b03008b082c030053082d03009e082e030034212f030034213003003421310300342149090400000000000000004b07010104574946492a36310d0a"));
+
+ verifyPositions(decoder, binary(
"2424423233322c3836323039303035303030323831332c4343452c0400000003004400110004050006000700fe6962060800000900000a00000b00001aef044023000602d65fbcfd03173b9c0804cc76ae2a0c14ae1b000d00aa0d001c01000000014b030101003f00100004050006000700fe695f060800000900000a00000b00001aea044016000502d65fbcfd03173b9c0804cf76ae2a0c14ae1b000d03aa0d00014b030101003f00100004050006000700fe695f060800000900000a00000b00001aed044001000502d65fbcfd03173b9c0804d076ae2a0c14ae1b000d04aa0d00014b030101002a30460d0a"));
verifyAttribute(decoder, buffer(