aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Mta6ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-05-04 11:10:55 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-05-04 11:10:55 +1200
commit93feb8a5484fd6c4c3da2032d4c843b3194b5ff7 (patch)
tree65902d2f1e71a776814d66b68d79c3a307febc2b /src/org/traccar/protocol/Mta6ProtocolDecoder.java
parent88e777a2ceb50e34dbe9577237483d8d3cebf346 (diff)
downloadtrackermap-server-93feb8a5484fd6c4c3da2032d4c843b3194b5ff7.tar.gz
trackermap-server-93feb8a5484fd6c4c3da2032d4c843b3194b5ff7.tar.bz2
trackermap-server-93feb8a5484fd6c4c3da2032d4c843b3194b5ff7.zip
Create prefixes for other data
Diffstat (limited to 'src/org/traccar/protocol/Mta6ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Mta6ProtocolDecoder.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
index c5bf2827b..3d977706f 100644
--- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
@@ -167,21 +167,21 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
}
if (checkBit(flags, 4)) {
- position.set("fuel1", buf.readUnsignedInt());
+ position.set(Event.KEY_FUEL, buf.readUnsignedInt());
position.set("fuel2", buf.readUnsignedInt());
position.set("hours1", buf.readUnsignedShort());
position.set("hours2", buf.readUnsignedShort());
}
if (checkBit(flags, 5)) {
- position.set("adc1", buf.readUnsignedShort() & 0x03ff);
- position.set("adc2", buf.readUnsignedShort() & 0x03ff);
- position.set("adc3", buf.readUnsignedShort() & 0x03ff);
- position.set("adc4", buf.readUnsignedShort() & 0x03ff);
+ position.set(Event.PREFIX_ADC + 1, buf.readUnsignedShort() & 0x03ff);
+ position.set(Event.PREFIX_ADC + 2, buf.readUnsignedShort() & 0x03ff);
+ position.set(Event.PREFIX_ADC + 3, buf.readUnsignedShort() & 0x03ff);
+ position.set(Event.PREFIX_ADC + 4, buf.readUnsignedShort() & 0x03ff);
}
if (checkBit(flags, 6)) {
- position.set(Event.KEY_TEMPERATURE, buf.readByte());
+ position.set(Event.PREFIX_TEMP + 1, buf.readByte());
buf.getUnsignedByte(buf.readerIndex()); // control (>> 4)
position.set("sensor", buf.readUnsignedShort() & 0x0fff);
buf.readUnsignedShort(); // old sensor state (& 0x0fff)
@@ -247,19 +247,19 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
if (checkBit(flags, 2)) {
position.set("engine", buf.readUnsignedShort() * 0.125);
position.set("pedals", buf.readUnsignedByte());
- position.set(Event.KEY_TEMPERATURE, buf.readUnsignedByte() - 40);
+ position.set(Event.PREFIX_TEMP + 1, buf.readUnsignedByte() - 40);
buf.readUnsignedShort(); // service odometer
}
if (checkBit(flags, 3)) {
position.set(Event.KEY_FUEL, buf.readUnsignedShort());
- position.set("adc2", buf.readUnsignedShort());
- position.set("adc3", buf.readUnsignedShort());
- position.set("adc4", buf.readUnsignedShort());
+ position.set(Event.PREFIX_ADC + 2, buf.readUnsignedShort());
+ position.set(Event.PREFIX_ADC + 3, buf.readUnsignedShort());
+ position.set(Event.PREFIX_ADC + 4, buf.readUnsignedShort());
}
if (checkBit(flags, 4)) {
- position.set(Event.KEY_TEMPERATURE, buf.readByte());
+ position.set(Event.PREFIX_TEMP + 1, buf.readByte());
buf.getUnsignedByte(buf.readerIndex()); // control (>> 4)
position.set("sensor", buf.readUnsignedShort() & 0x0fff);
buf.readUnsignedShort(); // old sensor state (& 0x0fff)