aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Mta6ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-03-08 19:14:23 +1300
committerGitHub <noreply@github.com>2017-03-08 19:14:23 +1300
commite3a3f06cc07bc5d75d3d670e045abb5d6c91fcad (patch)
treeee424dc1b6b86abb54abcc5fe4f2068ac0cbf286 /src/org/traccar/protocol/Mta6ProtocolDecoder.java
parentb7e53f57689e1f8a1c0705aeea32dc6e69f3fcb3 (diff)
parentf94613b97cf80af64154ae571920a273771fa1d3 (diff)
downloadtrackermap-server-e3a3f06cc07bc5d75d3d670e045abb5d6c91fcad.tar.gz
trackermap-server-e3a3f06cc07bc5d75d3d670e045abb5d6c91fcad.tar.bz2
trackermap-server-e3a3f06cc07bc5d75d3d670e045abb5d6c91fcad.zip
Merge pull request #2979 from jon-stumpf/jss-add-info
Additional Protocol Information
Diffstat (limited to 'src/org/traccar/protocol/Mta6ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Mta6ProtocolDecoder.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
index 2a3d84a2c..0fda94eef 100644
--- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
@@ -182,7 +182,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
if (BitUtil.check(flags, 7)) {
position.set(Position.KEY_BATTERY, buf.getUnsignedByte(buf.readerIndex()) >> 2);
position.set(Position.KEY_POWER, buf.readUnsignedShort() & 0x03ff);
- buf.readByte(); // microcontroller temperature
+ position.set(Position.KEY_DEVICE_TEMP, buf.readByte());
position.set(Position.KEY_RSSI, (buf.getUnsignedByte(buf.readerIndex()) >> 4) & 0x07);
@@ -222,7 +222,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
position.setLongitude(new FloatReader().readFloat(buf) / Math.PI * 180);
position.setTime(new TimeReader().readTime(buf));
- buf.readUnsignedByte(); // status
+ position.set(Position.KEY_STATUS, buf.readUnsignedByte());
if (BitUtil.check(flags, 0)) {
position.setAltitude(buf.readUnsignedShort());
@@ -233,7 +233,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
if (BitUtil.check(flags, 1)) {
position.set(Position.KEY_FUEL_CONSUMPTION, new FloatReader().readFloat(buf));
- position.set("hours", new FloatReader().readFloat(buf));
+ position.set(Position.KEY_HOURS, new FloatReader().readFloat(buf));
position.set("tank", buf.readUnsignedByte() * 0.4);
}
@@ -241,11 +241,11 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
position.set("engine", buf.readUnsignedShort() * 0.125);
position.set("pedals", buf.readUnsignedByte());
position.set(Position.PREFIX_TEMP + 1, buf.readUnsignedByte() - 40);
- buf.readUnsignedShort(); // service odometer
+ position.set(Position.KEY_ODOMETER_SERVICE, buf.readUnsignedShort());
}
if (BitUtil.check(flags, 3)) {
- position.set(Position.KEY_FUEL, buf.readUnsignedShort());
+ position.set(Position.KEY_FUEL_LEVEL, buf.readUnsignedShort());
position.set(Position.PREFIX_ADC + 2, buf.readUnsignedShort());
position.set(Position.PREFIX_ADC + 3, buf.readUnsignedShort());
position.set(Position.PREFIX_ADC + 4, buf.readUnsignedShort());
@@ -261,7 +261,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
if (BitUtil.check(flags, 5)) {
position.set(Position.KEY_BATTERY, buf.getUnsignedByte(buf.readerIndex()) >> 2);
position.set(Position.KEY_POWER, buf.readUnsignedShort() & 0x03ff);
- buf.readByte(); // microcontroller temperature
+ position.set(Position.KEY_DEVICE_TEMP, buf.readByte());
position.set(Position.KEY_RSSI, buf.getUnsignedByte(buf.readerIndex()) >> 5);