From e2a7ac2da731a9b5ffb4ea49cf92d597d68ca0c5 Mon Sep 17 00:00:00 2001 From: errohitsinghal Date: Sun, 20 Apr 2014 12:28:28 +0530 Subject: Update CarTrackProtocolDecoder.java Mileage Data is encrypted to HEX and Special Chars. I have made change as per logic. --- src/org/traccar/protocol/CarTrackProtocolDecoder.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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++)); -- cgit v1.2.3