aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-09-24 12:05:22 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-09-24 12:05:22 +1200
commit9b7c0f367218e69b14a77bcdbdd58d524b4e78d2 (patch)
tree5ee654abf9cff85f4e591af9cd7452973d22d6ef /src/org/traccar
parent38358bad4ea11a3fa6f581042fe5978f14f32d26 (diff)
downloadtraccar-server-9b7c0f367218e69b14a77bcdbdd58d524b4e78d2.tar.gz
traccar-server-9b7c0f367218e69b14a77bcdbdd58d524b4e78d2.tar.bz2
traccar-server-9b7c0f367218e69b14a77bcdbdd58d524b4e78d2.zip
Decode GL200 OBD attributes
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index 503717eba..b51851773 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -54,19 +54,19 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
"[01]," + // ODB connect
"\\d{1,5}," + // ODB voltage
"\\p{XDigit}{8}," + // Support PIDs
- "\\d{1,5}," + // Engine RPM
- "\\d{1,3}," + // Speed
- "-?\\d{1,3}," + // Coolant temp
+ "(\\d{1,5})," + // Engine RPM
+ "(\\d{1,3})," + // Speed
+ "(-?\\d{1,3})," + // Coolant temp
"(\\d+\\.?\\d*|Inf|NaN)?," + // Fuel consumption
- "\\d{1,5}," + // Odometer
+ "(\\d{1,5})," + // DTCs cleared distance
"\\d{1,5}," +
- "[01]," + // ODB connect
- "\\d{1,3}," + // Number of DTCs
- "\\p{XDigit}*," + // DTCs
- "\\d{1,3}," + // Throttle
+ "([01])," + // ODB connect
+ "(\\d{1,3})," + // Number of DTCs
+ "(\\p{XDigit}*)," + // DTCs
+ "(\\d{1,3})," + // Throttle
"\\d{1,3}," + // Engine load
"(\\d{1,3})?,"+ // Fuel level
- "\\d+|.*)," + // Odometer
+ "(\\d+)|.*)," + // Odometer
"(\\d*)," + // GPS accuracy
"(\\d+.\\d)?," + // Speed
@@ -81,7 +81,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
"(\\p{XDigit}{4}|\\p{XDigit}{8})?," + // LAC
"(\\p{XDigit}{4})?," + // Cell
"(?:(\\d+\\.\\d)?," + // Odometer
- "(\\d{1,3})?,)?" + // Battery*/
+ "(\\d{1,3})?,)?" + // Battery
".*," +
"(\\p{XDigit}{4})\\$?");
@@ -119,9 +119,18 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
}
position.setDeviceId(getDeviceId());
- // Fuel
+ // OBD
+ position.set("engine-rpm", parser.group(index++));
+ position.set("obd-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++));
+ position.set("odb-connect", parser.group(index++));
+ position.set("dtcs-number", parser.group(index++));
+ position.set("dtcs-codes", parser.group(index++));
+ position.set("throttle-position", parser.group(index++));
position.set(Event.KEY_FUEL, parser.group(index++));
+ position.set("odb-odometer", parser.group(index++));
// Validity
position.setValid(Integer.valueOf(parser.group(index++)) < 20);