From 9b08cbbca6a35862fbc33e48f5d876899954a17d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 28 Sep 2015 11:47:46 +1300 Subject: Decode extra Tytan parameters --- src/org/traccar/model/Event.java | 2 ++ src/org/traccar/protocol/AplicomProtocolDecoder.java | 2 +- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 4 ++-- src/org/traccar/protocol/IntellitracProtocolDecoder.java | 4 ++-- src/org/traccar/protocol/TytanProtocolDecoder.java | 6 ++++++ 5 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/model/Event.java b/src/org/traccar/model/Event.java index 5ad6c38fe..2f78dd0f4 100644 --- a/src/org/traccar/model/Event.java +++ b/src/org/traccar/model/Event.java @@ -80,6 +80,8 @@ public abstract class Event { public static final String KEY_ARCHIVE = "archive"; public static final String KEY_DISTANCE = "distance"; public static final String KEY_DOOR = "door"; + public static final String KEY_RPM = "rpm"; + public static final String KEY_SPEED = "speed"; // OBD speed // Starts with 1 not 0 public static final String PREFIX_TEMP = "temp"; diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java index 490f70e1b..574ff09c3 100644 --- a/src/org/traccar/protocol/AplicomProtocolDecoder.java +++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java @@ -273,7 +273,7 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder { ChannelBuffer value = values.get(i); switch (buf.readInt()) { case 0x20D: - position.set("diesel-rpm", ChannelBuffers.swapShort(value.readShort())); + position.set(Event.KEY_RPM, ChannelBuffers.swapShort(value.readShort())); position.set("diesel-temperature", ChannelBuffers.swapShort(value.readShort()) * 0.1); position.set("battery-voltage", ChannelBuffers.swapShort(value.readShort()) * 0.01); position.set("supply-air-temp-dep1", ChannelBuffers.swapShort(value.readShort()) * 0.1); diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index b51851773..a7cf1121b 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -120,8 +120,8 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.setDeviceId(getDeviceId()); // OBD - position.set("engine-rpm", parser.group(index++)); - position.set("obd-speed", parser.group(index++)); + position.set(Event.KEY_RPM, parser.group(index++)); + position.set(Event.KEY_SPEED, parser.group(index++)); position.set(Event.PREFIX_TEMP + 1, parser.group(index++)); position.set("fuel-consumption", parser.group(index++)); position.set("dtcs-cleared-distance", parser.group(index++)); diff --git a/src/org/traccar/protocol/IntellitracProtocolDecoder.java b/src/org/traccar/protocol/IntellitracProtocolDecoder.java index 25d0914d7..a2c16e915 100644 --- a/src/org/traccar/protocol/IntellitracProtocolDecoder.java +++ b/src/org/traccar/protocol/IntellitracProtocolDecoder.java @@ -122,8 +122,8 @@ public class IntellitracProtocolDecoder extends BaseProtocolDecoder { position.set(Event.PREFIX_ADC + 2, parser.group(index++)); // J1939 data - position.set("vss", parser.group(index++)); - position.set("rpm", parser.group(index++)); + position.set(Event.KEY_SPEED, parser.group(index++)); + position.set(Event.KEY_RPM, parser.group(index++)); position.set("coolant", parser.group(index++)); position.set(Event.KEY_FUEL, parser.group(index++)); position.set("consumption", parser.group(index++)); diff --git a/src/org/traccar/protocol/TytanProtocolDecoder.java b/src/org/traccar/protocol/TytanProtocolDecoder.java index 04d095a9f..bcab7ed21 100644 --- a/src/org/traccar/protocol/TytanProtocolDecoder.java +++ b/src/org/traccar/protocol/TytanProtocolDecoder.java @@ -170,6 +170,12 @@ public class TytanProtocolDecoder extends BaseProtocolDecoder { case 90: position.set(Event.KEY_POWER, readSwappedFloat(buf)); break; + case 101: + position.set(Event.KEY_SPEED, buf.readUnsignedByte()); + break; + case 102: + position.set(Event.KEY_RPM, buf.readUnsignedByte() * 50); + break; case 107: position.set(Event.KEY_FUEL, (buf.readUnsignedShort() & 0x3fff) * 0.5); break; -- cgit v1.2.3