diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-09-28 13:40:00 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-09-28 13:40:00 +1200 |
commit | 53494de4e41e1c4d4440c9afc0c4a9dfa6480558 (patch) | |
tree | 9dc441029fbcb5ea71b83c49ef89599012bcccc8 /src/org/traccar/protocol/NavigilProtocolDecoder.java | |
parent | c1b6fb0e25020b845b059aef0adebeac7d90ed7c (diff) | |
download | trackermap-server-53494de4e41e1c4d4440c9afc0c4a9dfa6480558.tar.gz trackermap-server-53494de4e41e1c4d4440c9afc0c4a9dfa6480558.tar.bz2 trackermap-server-53494de4e41e1c4d4440c9afc0c4a9dfa6480558.zip |
Remove optional fields
Diffstat (limited to 'src/org/traccar/protocol/NavigilProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/NavigilProtocolDecoder.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java index 34642496a..29be1e5ad 100644 --- a/src/org/traccar/protocol/NavigilProtocolDecoder.java +++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java @@ -83,7 +83,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); position.setValid(true); - position.setId((long) sequenceNumber); + extendedInfo.set("index", sequenceNumber); position.setDeviceId(deviceId); buf.readUnsignedShort(); // report trigger @@ -102,8 +102,8 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedInt(); // distance buf.readUnsignedInt(); // delta distance - - position.setPower(buf.readUnsignedShort() * 0.001); + + extendedInfo.set("battery", buf.readUnsignedShort() * 0.001); buf.readUnsignedShort(); // battery charger status @@ -120,7 +120,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); position.setValid(true); - position.setId((long) sequenceNumber); + extendedInfo.set("index", sequenceNumber); position.setDeviceId(deviceId); buf.readUnsignedShort(); // report trigger @@ -146,7 +146,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedShort(); // VSAUT1 voltage buf.readUnsignedShort(); // VSAUT2 voltage buf.readUnsignedShort(); // solar voltage - position.setPower(buf.readUnsignedShort() * 0.001); // battery voltage + extendedInfo.set("battery", buf.readUnsignedShort() * 0.001); // TODO: a lot of other stuff @@ -158,7 +158,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); - position.setId((long) sequenceNumber); + extendedInfo.set("index", sequenceNumber); position.setDeviceId(deviceId); position.setTime(convertTimestamp(timestamp)); @@ -182,7 +182,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); - position.setId((long) sequenceNumber); + extendedInfo.set("index", sequenceNumber); position.setDeviceId(deviceId); position.setTime(convertTimestamp(timestamp)); @@ -209,7 +209,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); - position.setId((long) sequenceNumber); + extendedInfo.set("index", sequenceNumber); position.setDeviceId(deviceId); buf.readUnsignedByte(); // report trigger @@ -238,7 +238,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); // supply voltage 1 buf.readUnsignedByte(); // supply voltage 2 - position.setPower(buf.readUnsignedByte() * 0.01 + 2.5); // battery voltage + extendedInfo.set("battery", buf.readUnsignedShort() * 0.001); // TODO: a lot of other stuff @@ -250,7 +250,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(); ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("navigil"); - position.setId((long) sequenceNumber); + extendedInfo.set("index", sequenceNumber); position.setDeviceId(deviceId); position.setTime(convertTimestamp(timestamp)); @@ -270,7 +270,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); // satellites in fix - position.setPower(buf.readUnsignedByte() * 0.005 + 3.0); // battery voltage + extendedInfo.set("battery", buf.readUnsignedShort() * 0.001); buf.readUnsignedInt(); // distance |