aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/CarTrackProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-05-04 10:53:27 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-05-04 10:53:27 +1200
commit88e777a2ceb50e34dbe9577237483d8d3cebf346 (patch)
tree6b2058f1cf43e56a4be20d981acd8b03452bdc8e /src/org/traccar/protocol/CarTrackProtocolDecoder.java
parentbbfd08e59ba23c6aee85bc1083588529a7b90ebb (diff)
downloadtrackermap-server-88e777a2ceb50e34dbe9577237483d8d3cebf346.tar.gz
trackermap-server-88e777a2ceb50e34dbe9577237483d8d3cebf346.tar.bz2
trackermap-server-88e777a2ceb50e34dbe9577237483d8d3cebf346.zip
Create other data keys
Diffstat (limited to 'src/org/traccar/protocol/CarTrackProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/CarTrackProtocolDecoder.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/org/traccar/protocol/CarTrackProtocolDecoder.java b/src/org/traccar/protocol/CarTrackProtocolDecoder.java
index b88f9840d..06f1e5342 100644
--- a/src/org/traccar/protocol/CarTrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/CarTrackProtocolDecoder.java
@@ -25,6 +25,7 @@ import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.traccar.BaseProtocolDecoder;
+import org.traccar.model.Event;
import org.traccar.model.Position;
public class CarTrackProtocolDecoder extends BaseProtocolDecoder {
@@ -124,19 +125,18 @@ public class CarTrackProtocolDecoder extends BaseProtocolDecoder {
// State
position.set("io", parser.group(index++));
- /* Start : Added By Rohit Singhal, Decode Milage Data*/
- // Prepare Mile Meter Data
- String milage = parser.group(index++);
- milage = milage.replace(":", "A");
- milage = milage.replace(";", "B");
- milage = milage.replace("<", "C");
- milage = milage.replace("=", "D");
- milage = milage.replace(">", "E");
- milage = milage.replace("?", "F");
- position.set("milage", Integer.parseInt(milage, 16));
- /* Commented By Rohit position.set("milage", parser.group(index++)); */
- /*End : Added By Rohit Singhal, Decode Milage Data*/
- position.set("alarm", parser.group(index++));
+
+ // Odometer
+ String odometer = parser.group(index++);
+ odometer = odometer.replace(":", "A");
+ odometer = odometer.replace(";", "B");
+ odometer = odometer.replace("<", "C");
+ odometer = odometer.replace("=", "D");
+ odometer = odometer.replace(">", "E");
+ odometer = odometer.replace("?", "F");
+ position.set(Event.KEY_ODOMETER, Integer.parseInt(odometer, 16));
+
+ position.set(Event.KEY_ALARM, parser.group(index++));
position.set("ad", parser.group(index++));
return position;
}