diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-04 10:53:27 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-04 10:53:27 +1200 |
commit | 88e777a2ceb50e34dbe9577237483d8d3cebf346 (patch) | |
tree | 6b2058f1cf43e56a4be20d981acd8b03452bdc8e /src/org/traccar/protocol/PiligrimProtocolDecoder.java | |
parent | bbfd08e59ba23c6aee85bc1083588529a7b90ebb (diff) | |
download | trackermap-server-88e777a2ceb50e34dbe9577237483d8d3cebf346.tar.gz trackermap-server-88e777a2ceb50e34dbe9577237483d8d3cebf346.tar.bz2 trackermap-server-88e777a2ceb50e34dbe9577237483d8d3cebf346.zip |
Create other data keys
Diffstat (limited to 'src/org/traccar/protocol/PiligrimProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/PiligrimProtocolDecoder.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/PiligrimProtocolDecoder.java b/src/org/traccar/protocol/PiligrimProtocolDecoder.java index f4eafd833..30b81f5fb 100644 --- a/src/org/traccar/protocol/PiligrimProtocolDecoder.java +++ b/src/org/traccar/protocol/PiligrimProtocolDecoder.java @@ -34,6 +34,7 @@ import org.jboss.netty.handler.codec.http.HttpVersion; import org.jboss.netty.handler.codec.http.QueryStringDecoder; import org.traccar.BaseProtocolDecoder; +import org.traccar.model.Event; import org.traccar.model.Position; public class PiligrimProtocolDecoder extends BaseProtocolDecoder { @@ -133,7 +134,7 @@ public class PiligrimProtocolDecoder extends BaseProtocolDecoder { // Satellites int satellites = buf.readUnsignedByte(); - position.set("satellites", satellites); + position.set(Event.KEY_SATELLITES, satellites); position.setValid(satellites >= 3); // Speed @@ -151,12 +152,12 @@ public class PiligrimProtocolDecoder extends BaseProtocolDecoder { // External power double power = buf.readUnsignedByte(); power += buf.readUnsignedByte() << 8; - position.set("power", power / 100); + position.set(Event.KEY_POWER, power / 100); // Battery double battery = buf.readUnsignedByte(); battery += buf.readUnsignedByte() << 8; - position.set("battery", battery / 100); + position.set(Event.KEY_BATTERY, battery / 100); buf.skipBytes(6); |