aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/BceProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-05-04 10:53:27 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-05-04 10:53:27 +1200
commit88e777a2ceb50e34dbe9577237483d8d3cebf346 (patch)
tree6b2058f1cf43e56a4be20d981acd8b03452bdc8e /src/org/traccar/protocol/BceProtocolDecoder.java
parentbbfd08e59ba23c6aee85bc1083588529a7b90ebb (diff)
downloadtrackermap-server-88e777a2ceb50e34dbe9577237483d8d3cebf346.tar.gz
trackermap-server-88e777a2ceb50e34dbe9577237483d8d3cebf346.tar.bz2
trackermap-server-88e777a2ceb50e34dbe9577237483d8d3cebf346.zip
Create other data keys
Diffstat (limited to 'src/org/traccar/protocol/BceProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/BceProtocolDecoder.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/org/traccar/protocol/BceProtocolDecoder.java b/src/org/traccar/protocol/BceProtocolDecoder.java
index 28570b63c..5baafd9dd 100644
--- a/src/org/traccar/protocol/BceProtocolDecoder.java
+++ b/src/org/traccar/protocol/BceProtocolDecoder.java
@@ -25,6 +25,7 @@ import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.traccar.BaseProtocolDecoder;
+import org.traccar.model.Event;
import org.traccar.model.Position;
public class BceProtocolDecoder extends BaseProtocolDecoder {
@@ -97,17 +98,17 @@ public class BceProtocolDecoder extends BaseProtocolDecoder {
position.setSpeed(buf.readUnsignedByte());
int gps = buf.readUnsignedByte();
- position.set("satellites", gps & 0xf);
- position.set("hdop", gps >> 4);
+ position.set(Event.KEY_SATELLITES, gps & 0xf);
+ position.set(Event.KEY_HDOP, gps >> 4);
position.setCourse(buf.readUnsignedByte());
position.setAltitude(buf.readUnsignedShort());
- position.set("milage", buf.readUnsignedInt());
+ position.set(Event.KEY_ODOMETER, buf.readUnsignedInt());
}
if (checkBit(mask, 1)) {
- position.set("input", buf.readUnsignedShort());
+ position.set(Event.KEY_INPUT, buf.readUnsignedShort());
}
for (int i = 1; i <= 8; i++) {
@@ -122,11 +123,11 @@ public class BceProtocolDecoder extends BaseProtocolDecoder {
if (checkBit(mask, 13)) buf.skipBytes(2);
if (checkBit(mask, 14)) {
- position.set("mcc", buf.readUnsignedShort());
- position.set("mnc", buf.readUnsignedByte());
- position.set("lac", buf.readUnsignedShort());
- position.set("cell", buf.readUnsignedShort());
- position.set("gsm", buf.readUnsignedByte());
+ position.set(Event.KEY_MCC, buf.readUnsignedShort());
+ position.set(Event.KEY_MNC, buf.readUnsignedByte());
+ position.set(Event.KEY_LAC, buf.readUnsignedShort());
+ position.set(Event.KEY_CELL, buf.readUnsignedShort());
+ position.set(Event.KEY_GSM, buf.readUnsignedByte());
buf.readUnsignedByte();
}