aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-11-17 07:55:35 -0800
committerAnton Tananaev <anton@traccar.org>2023-11-17 07:55:35 -0800
commiteacc6603272ba06ea257807415a966474e8cd020 (patch)
treed17d68d71db25c4d353a6810ce6b4341ad4fd250 /src
parente62f2e19b8f07af2a37f5e2cfe4c380c31b5c7db (diff)
downloadtrackermap-server-eacc6603272ba06ea257807415a966474e8cd020.tar.gz
trackermap-server-eacc6603272ba06ea257807415a966474e8cd020.tar.bz2
trackermap-server-eacc6603272ba06ea257807415a966474e8cd020.zip
Support T711L sensor data
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java14
-rw-r--r--src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java4
2 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java
index ea3302c30..1235ca9fe 100644
--- a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java
@@ -587,6 +587,20 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // alarm type
buf.skipBytes(length - 2);
break;
+ case 0xFE73:
+ buf.readUnsignedByte(); // version
+ position.set(
+ "tagName",
+ buf.readCharSequence(buf.readUnsignedByte(), StandardCharsets.US_ASCII).toString());
+ buf.skipBytes(6); // mac
+ position.set("tagBattery", buf.readUnsignedByte());
+ position.set("tagTemp", buf.readUnsignedShortLE() / 256.0);
+ position.set("tagHumidity", buf.readUnsignedShortLE() / 256.0);
+ buf.readUnsignedShortLE(); // high temperature threshold
+ buf.readUnsignedShortLE(); // low temperature threshold
+ buf.readUnsignedShortLE(); // high humidity threshold
+ buf.readUnsignedShortLE(); // low humidity threshold
+ break;
case 0xFEA8:
for (int k = 1; k <= 3; k++) {
if (buf.readUnsignedByte() > 0) {
diff --git a/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java
index 91dcf0386..24dc9d18e 100644
--- a/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java
@@ -12,6 +12,10 @@ public class MeitrackProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new MeitrackProtocolDecoder(null));
verifyAttribute(decoder, binary(
+ "2424593136312c3836323039303035303031363139332c4343452c0000000001007f0017000705010607071714001500fe69601b00070800000971000a13000b19001605001acc0440230006029779570103eb5bcc06041ff0e8290c430100000d780400001c01000000030e0ccc010000922781abb90ca4fffe731e0109746e6873656e736f72ac233f6e219064051b753b00000000000000004b060101034c54452a42380d0a"),
+ "tagName", "tnhsensor");
+
+ verifyAttribute(decoder, binary(
"2424683136342C3836363334343035333039353238322C4343452C000000000100820018000505000600070B14001500080800000900000A00000B00001606001A0000402300FE90000006022E79570103E55CCC0604E1FDB32B0CC32C00000D58EB02001C01000000050E0CCC010000B627BF11000000004B1001010D475052532847534D2039303029FEA50601FFFFFF7FFFFEA80701010258023800FEB20501010000002A41360D0A"),
"battery2Level", 88);