aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/NavigilProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-05-26 10:02:37 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2016-05-26 10:02:37 -0700
commitd3e34416e9825833fa1db02112c56981999df039 (patch)
treed21b4414b532bfc53c9a905f3caa09f70b43b59e /src/org/traccar/protocol/NavigilProtocolDecoder.java
parentac2405f0d57fac51fe95aa755f90fe82f26f73bc (diff)
parentaa12e5c750e771016545269ffa39409b06b47eee (diff)
downloadtraccar-server-d3e34416e9825833fa1db02112c56981999df039.tar.gz
traccar-server-d3e34416e9825833fa1db02112c56981999df039.tar.bz2
traccar-server-d3e34416e9825833fa1db02112c56981999df039.zip
Merge pull request #1978 from Abyss777/master
Simplification of the models hierarchy
Diffstat (limited to 'src/org/traccar/protocol/NavigilProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/NavigilProtocolDecoder.java23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java
index 22ae7ddee..8dd4e140b 100644
--- a/src/org/traccar/protocol/NavigilProtocolDecoder.java
+++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java
@@ -22,7 +22,6 @@ import org.traccar.BaseProtocolDecoder;
import org.traccar.helper.Checksum;
import org.traccar.helper.Log;
import org.traccar.helper.UnitsConverter;
-import org.traccar.model.Event;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -84,7 +83,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
position.setProtocol(getProtocolName());
position.setValid(true);
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
buf.readUnsignedShort(); // report trigger
@@ -104,7 +103,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedInt(); // distance
buf.readUnsignedInt(); // delta distance
- position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
buf.readUnsignedShort(); // battery charger status
@@ -118,7 +117,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
position.setProtocol(getProtocolName());
position.setValid(true);
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
buf.readUnsignedShort(); // report trigger
@@ -144,7 +143,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedShort(); // VSAUT1 voltage
buf.readUnsignedShort(); // VSAUT2 voltage
buf.readUnsignedShort(); // solar voltage
- position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
return position;
}
@@ -153,7 +152,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
Position position = new Position();
position.setProtocol(getProtocolName());
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
position.setTime(convertTimestamp(timestamp));
@@ -174,7 +173,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
Position position = new Position();
position.setProtocol(getProtocolName());
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
position.setTime(convertTimestamp(timestamp));
@@ -188,7 +187,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
short flags = buf.readUnsignedByte();
position.setValid((flags & 0x80) == 0x80 && (flags & 0x40) == 0x40);
- position.set(Event.KEY_SATELLITES, buf.readUnsignedByte());
+ position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
buf.readUnsignedInt(); // distance
return position;
}
@@ -197,7 +196,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
Position position = new Position();
position.setProtocol(getProtocolName());
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
buf.readUnsignedByte(); // report trigger
@@ -226,7 +225,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // supply voltage 1
buf.readUnsignedByte(); // supply voltage 2
- position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
return position;
}
@@ -235,7 +234,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
Position position = new Position();
position.setProtocol(getProtocolName());
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
position.setTime(convertTimestamp(timestamp));
@@ -254,7 +253,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // satellites in fix
- position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
buf.readUnsignedInt(); // distance
return position;