From c560535dda15f1d24b60c9595c603144e3ce766d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 26 Oct 2020 21:58:53 -0700 Subject: More Meitrack TC68L data --- .../traccar/protocol/MeitrackProtocolDecoder.java | 25 ++++++++++++++++++++++ .../protocol/MeitrackProtocolDecoderTest.java | 3 +++ 2 files changed, 28 insertions(+) diff --git a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java index 86df25819..c43f1ea83 100644 --- a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -421,6 +421,22 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { case 0x1A: position.set(Position.KEY_POWER, buf.readUnsignedShortLE() * 0.01); break; + case 0x91: + case 0x92: + position.set(Position.KEY_OBD_SPEED, buf.readUnsignedShortLE()); + break; + case 0x98: + position.set(Position.KEY_FUEL_USED, buf.readUnsignedShortLE()); + break; + case 0x99: + position.set(Position.KEY_RPM, buf.readUnsignedShortLE()); + break; + case 0x9C: + position.set(Position.KEY_COOLANT_TEMP, buf.readUnsignedShortLE()); + break; + case 0xC9: + position.set(Position.KEY_FUEL_CONSUMPTION, buf.readUnsignedShortLE()); + break; default: buf.readUnsignedShortLE(); break; @@ -440,9 +456,18 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { case 0x04: position.setTime(new Date((946684800 + buf.readUnsignedIntLE()) * 1000)); // 2000-01-01 break; + case 0x0C: + position.set(Position.KEY_ODOMETER, buf.readUnsignedIntLE()); + break; case 0x0D: position.set("runtime", buf.readUnsignedIntLE()); break; + case 0xA0: + position.set(Position.KEY_FUEL_USED, buf.readUnsignedIntLE() * 0.001); + break; + case 0xA2: + position.set(Position.KEY_FUEL_CONSUMPTION, buf.readUnsignedIntLE() * 0.01); + break; default: buf.readUnsignedIntLE(); break; diff --git a/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/MeitrackProtocolDecoderTest.java index 1384a1c76..ea7ea19a2 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 { MeitrackProtocolDecoder decoder = new MeitrackProtocolDecoder(null); + verifyPositions(decoder, binary( + "2424413132332c3836313538353034333230303836322c4343452c010000000100590015000305010609071b0b081c000939010a07000b1700199e011a9505921a0099c4089c5500c93e00405a000602a8b114000343f12e0604d18806270c654a2e000da20537009bb8963904010e0c0d020300aa7a0af69e0100002a35340d0a")); + verifyAttribute(decoder, buffer( "$$F153,867144025101013,AAA,35,25.219431,55.279918,200916155923,V,0,25,0,0,0.0,0,249701532,98374503,424|2|101C|A3AE,0800,0000|0000|0000|02D3|0103,00000011,*A0"), Position.KEY_INPUT, 8); -- cgit v1.2.3