aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/UproProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/UproProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/UproProtocolDecoder.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/UproProtocolDecoder.java b/src/org/traccar/protocol/UproProtocolDecoder.java
index d5a00c6df..c6f400cae 100644
--- a/src/org/traccar/protocol/UproProtocolDecoder.java
+++ b/src/org/traccar/protocol/UproProtocolDecoder.java
@@ -121,12 +121,23 @@ public class UproProtocolDecoder extends BaseProtocolDecoder {
case 'B':
position.set(Position.KEY_STATUS, data[i].substring(1));
break;
+ case 'C':
+ long odometer = 0;
+ for (int j = 1; j < data[i].length(); j++) {
+ odometer <<= 4;
+ odometer += data[i].charAt(j) - '0';
+ }
+ position.set(Position.KEY_ODOMETER, odometer);
+ break;
case 'P':
position.set(Position.KEY_MCC, Integer.parseInt(data[i].substring(1, 5)));
position.set(Position.KEY_MNC, Integer.parseInt(data[i].substring(5, 9)));
position.set(Position.KEY_LAC, Integer.parseInt(data[i].substring(9, 13), 16));
position.set(Position.KEY_CID, Integer.parseInt(data[i].substring(13, 17), 16));
break;
+ case 'S':
+ position.set("obd", data[i]);
+ break;
default:
break;
}