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/Xexun2ProtocolDecoder.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/Xexun2ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Xexun2ProtocolDecoder.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/Xexun2ProtocolDecoder.java b/src/org/traccar/protocol/Xexun2ProtocolDecoder.java index 420dfc8d0..8b654bef3 100644 --- a/src/org/traccar/protocol/Xexun2ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xexun2ProtocolDecoder.java @@ -24,6 +24,7 @@ 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 Xexun2ProtocolDecoder extends BaseProtocolDecoder { @@ -123,7 +124,7 @@ public class Xexun2ProtocolDecoder extends BaseProtocolDecoder { position.set("signal", parser.group(index++)); // Alarm - position.set("alarm", parser.group(index++)); + position.set(Event.KEY_ALARM, parser.group(index++)); // Get device by IMEI if (!identify(parser.group(index++))) { @@ -132,7 +133,7 @@ public class Xexun2ProtocolDecoder extends BaseProtocolDecoder { position.setDeviceId(getDeviceId()); // Satellites - position.set("satellites", parser.group(index++).replaceFirst ("^0*(?![\\.$])", "")); + position.set(Event.KEY_SATELLITES, parser.group(index++).replaceFirst ("^0*(?![\\.$])", "")); // Altitude String altitude = parser.group(index++); @@ -141,7 +142,7 @@ public class Xexun2ProtocolDecoder extends BaseProtocolDecoder { } // Power - position.set("power", Double.valueOf(parser.group(index++))); + position.set(Event.KEY_POWER, Double.valueOf(parser.group(index++))); return position; } |