aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-04-20 19:13:44 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2014-04-20 19:13:44 +1200
commit6bbd1a20873eae643b7df61333f2cef5cd57ee39 (patch)
tree6151eae5ba657d077a335533603dabbe344ea13c
parentdbc9910a144f9395e632d65862e8ac9989d516ec (diff)
parente2a7ac2da731a9b5ffb4ea49cf92d597d68ca0c5 (diff)
downloadtrackermap-server-6bbd1a20873eae643b7df61333f2cef5cd57ee39.tar.gz
trackermap-server-6bbd1a20873eae643b7df61333f2cef5cd57ee39.tar.bz2
trackermap-server-6bbd1a20873eae643b7df61333f2cef5cd57ee39.zip
Merge pull request #673 from errohitsinghal/patch-1
Update CarTrack protocol decoder
-rw-r--r--src/org/traccar/protocol/CarTrackProtocolDecoder.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/CarTrackProtocolDecoder.java b/src/org/traccar/protocol/CarTrackProtocolDecoder.java
index de730f00a..c5242497c 100644
--- a/src/org/traccar/protocol/CarTrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/CarTrackProtocolDecoder.java
@@ -130,7 +130,18 @@ public class CarTrackProtocolDecoder extends BaseProtocolDecoder {
// State
extendedInfo.set("io", parser.group(index++));
- extendedInfo.set("milage", 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");
+ extendedInfo.set("milage", Integer.parseInt(milage, 16));
+ /* Commented By Rohit extendedInfo.set("milage", parser.group(index++)); */
+ /*End : Added By Rohit Singhal, Decode Milage Data*/
extendedInfo.set("alarm", parser.group(index++));
extendedInfo.set("ad", parser.group(index++));