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/NavigilProtocolDecoder.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/NavigilProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/NavigilProtocolDecoder.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java index 76859aa05..a51acf3fe 100644 --- a/src/org/traccar/protocol/NavigilProtocolDecoder.java +++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java @@ -25,6 +25,7 @@ import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.helper.Crc; +import org.traccar.model.Event; import org.traccar.model.Position; public class NavigilProtocolDecoder extends BaseProtocolDecoder { @@ -82,7 +83,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocol()); position.setValid(true); - position.set("index", sequenceNumber); + position.set(Event.KEY_INDEX, sequenceNumber); position.setDeviceId(getDeviceId()); buf.readUnsignedShort(); // report trigger @@ -102,7 +103,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedInt(); // distance buf.readUnsignedInt(); // delta distance - position.set("battery", buf.readUnsignedShort() * 0.001); + position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001); buf.readUnsignedShort(); // battery charger status @@ -117,7 +118,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocol()); position.setValid(true); - position.set("index", sequenceNumber); + position.set(Event.KEY_INDEX, sequenceNumber); position.setDeviceId(getDeviceId()); buf.readUnsignedShort(); // report trigger @@ -143,7 +144,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedShort(); // VSAUT1 voltage buf.readUnsignedShort(); // VSAUT2 voltage buf.readUnsignedShort(); // solar voltage - position.set("battery", buf.readUnsignedShort() * 0.001); + position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001); // TODO: a lot of other stuff return position; @@ -153,7 +154,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); position.setProtocol(getProtocol()); - position.set("index", sequenceNumber); + position.set(Event.KEY_INDEX, sequenceNumber); position.setDeviceId(getDeviceId()); position.setTime(convertTimestamp(timestamp)); @@ -174,7 +175,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); position.setProtocol(getProtocol()); - position.set("index", sequenceNumber); + position.set(Event.KEY_INDEX, sequenceNumber); position.setDeviceId(getDeviceId()); position.setTime(convertTimestamp(timestamp)); @@ -197,7 +198,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); position.setProtocol(getProtocol()); - position.set("index", sequenceNumber); + position.set(Event.KEY_INDEX, sequenceNumber); position.setDeviceId(getDeviceId()); buf.readUnsignedByte(); // report trigger @@ -226,7 +227,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); // supply voltage 1 buf.readUnsignedByte(); // supply voltage 2 - position.set("battery", buf.readUnsignedShort() * 0.001); + position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001); // TODO: a lot of other stuff return position; @@ -236,7 +237,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); position.setProtocol(getProtocol()); - position.set("index", sequenceNumber); + position.set(Event.KEY_INDEX, sequenceNumber); position.setDeviceId(getDeviceId()); position.setTime(convertTimestamp(timestamp)); @@ -255,7 +256,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); // satellites in fix - position.set("battery", buf.readUnsignedShort() * 0.001); + position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001); buf.readUnsignedInt(); // distance return position; |