aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-08-25 14:59:17 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-08-25 14:59:17 +1200
commit763c2fac94e48c1a96b5d3bd1949e91dbca0a7f8 (patch)
tree751a638808b8b726f010d87436bb6bde78c69f6c /src/org
parent2dbe885fda32cce8da7519aac13c20fe733650a9 (diff)
downloadtrackermap-server-763c2fac94e48c1a96b5d3bd1949e91dbca0a7f8.tar.gz
trackermap-server-763c2fac94e48c1a96b5d3bd1949e91dbca0a7f8.tar.bz2
trackermap-server-763c2fac94e48c1a96b5d3bd1949e91dbca0a7f8.zip
Decode GV500 fuel information
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index 3628730e3..38b1df1a6 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -44,7 +44,30 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
"(?:\\x00?\\x04,\\p{XDigit}{4},[01],))" +
"GT...," +
"(?:[0-9A-Z]{2}\\p{XDigit}{4})?," + // Protocol version
- "([^,]+),.*," + // IMEI
+ "([^,]+)," + // IMEI
+
+ "(?:[0-9A-Z]{17}," + // VIN
+ "[^,]{0,20}," + // Device name
+ "[01]," + // Report type
+ "\\p{XDigit}{1,8}," + // Report mask
+ "[0-9A-Z]{17}," + // VIN
+ "[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+\\.?\\d*|Inf|NaN)?," + // Fuel consumption
+ "\\d{1,5}," + // Odometer
+ "\\d{1,5}," +
+ "[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*)," + // GPS accuracy
"(\\d+.\\d)?," + // Speed
"(\\d+)?," + // Course
@@ -58,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})\\$?");
@@ -96,6 +119,10 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
}
position.setDeviceId(getDeviceId());
+ // Fuel
+ position.set("fuel-consumption", parser.group(index++));
+ position.set(Event.KEY_FUEL, parser.group(index++));
+
// Validity
position.setValid(Integer.valueOf(parser.group(index++)) < 20);