From 763c2fac94e48c1a96b5d3bd1949e91dbca0a7f8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 25 Aug 2015 14:59:17 +1200 Subject: Decode GV500 fuel information --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3