diff options
author | errohitsinghal <errohitsinghal@gmail.com> | 2014-04-20 12:28:28 +0530 |
---|---|---|
committer | errohitsinghal <errohitsinghal@gmail.com> | 2014-04-20 12:28:28 +0530 |
commit | e2a7ac2da731a9b5ffb4ea49cf92d597d68ca0c5 (patch) | |
tree | 6151eae5ba657d077a335533603dabbe344ea13c /src/org/traccar | |
parent | dbc9910a144f9395e632d65862e8ac9989d516ec (diff) | |
download | traccar-server-e2a7ac2da731a9b5ffb4ea49cf92d597d68ca0c5.tar.gz traccar-server-e2a7ac2da731a9b5ffb4ea49cf92d597d68ca0c5.tar.bz2 traccar-server-e2a7ac2da731a9b5ffb4ea49cf92d597d68ca0c5.zip |
Update CarTrackProtocolDecoder.java
Mileage Data is encrypted to HEX and Special Chars. I have made change as per logic.
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/CarTrackProtocolDecoder.java | 13 |
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++)); |