aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-12-21 21:32:43 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-12-21 21:32:43 +1300
commitcceb668c8d65a638407229120791cfc415964e11 (patch)
treeed57b32cf66661114b1f23dfa695a8f0ea4a7c7f /src
parent4237194639161293e97d79443bb152819320c862 (diff)
downloadtraccar-server-cceb668c8d65a638407229120791cfc415964e11.tar.gz
traccar-server-cceb668c8d65a638407229120791cfc415964e11.tar.bz2
traccar-server-cceb668c8d65a638407229120791cfc415964e11.zip
Add J1939 to Intellitrac
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/IntellitracProtocolDecoder.java35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/org/traccar/protocol/IntellitracProtocolDecoder.java b/src/org/traccar/protocol/IntellitracProtocolDecoder.java
index e45c84ba9..de834965c 100644
--- a/src/org/traccar/protocol/IntellitracProtocolDecoder.java
+++ b/src/org/traccar/protocol/IntellitracProtocolDecoder.java
@@ -47,7 +47,18 @@ public class IntellitracProtocolDecoder extends BaseProtocolDecoder {
"(\\d+)," + // Input
"(\\d+),?" + // Output
"(\\d+\\.\\d+)?,?" + // ADC1
- "(\\d+\\.\\d+)?" + // ADC2
+ "(\\d+\\.\\d+)?,?" + // ADC2
+ "(?:\\d{14},\\d+," +
+ "(\\d+)," + // VSS
+ "(\\d+)," + // RPM
+ "(-?\\d+)," + // Coolant
+ "(\\d+)," + // Fuel
+ "(\\d+)," + // Fuel Consumption
+ "(-?\\d+)," + // Fuel Temperature
+ "(\\d+)," + // Charger Pressure
+ "(\\d+)," + // TPL
+ "(\\d+)," + // Axle Weight
+ "(\\d+))?" + // Milage
".*");
@Override
@@ -110,17 +121,23 @@ public class IntellitracProtocolDecoder extends BaseProtocolDecoder {
extendedInfo.set("output", parser.group(index++));
// ADC1
- String adc1 = parser.group(index++);
- if (adc1 != null) {
- extendedInfo.set("adc1", adc1);
- }
+ extendedInfo.set("adc1", parser.group(index++));
// ADC2
- String adc2 = parser.group(index++);
- if (adc2 != null) {
- extendedInfo.set("adc2", adc2);
- }
+ extendedInfo.set("adc2", parser.group(index++));
+ // J1939 data
+ extendedInfo.set("vss", parser.group(index++));
+ extendedInfo.set("rpm", parser.group(index++));
+ extendedInfo.set("coolant", parser.group(index++));
+ extendedInfo.set("fuel", parser.group(index++));
+ extendedInfo.set("consumption", parser.group(index++));
+ extendedInfo.set("temperature", parser.group(index++));
+ extendedInfo.set("charger", parser.group(index++));
+ extendedInfo.set("tpl", parser.group(index++));
+ extendedInfo.set("axle", parser.group(index++));
+ extendedInfo.set("milage", parser.group(index++));
+
position.setExtendedInfo(extendedInfo.toString());
return position;
}