aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/CellocatorProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-02-26 15:12:08 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-02-26 15:12:08 +1300
commit3302d7cf5e7d776da723b811f7daf7a7bd24bb25 (patch)
tree1cfa8a9394e10aabb7e5f90f9c883a539f309ae1 /src/org/traccar/protocol/CellocatorProtocolDecoder.java
parentaea5d9e8df58b37c937db87a272a9d92c64586f5 (diff)
downloadtrackermap-server-3302d7cf5e7d776da723b811f7daf7a7bd24bb25.tar.gz
trackermap-server-3302d7cf5e7d776da723b811f7daf7a7bd24bb25.tar.bz2
trackermap-server-3302d7cf5e7d776da723b811f7daf7a7bd24bb25.zip
Some minor clean up
Diffstat (limited to 'src/org/traccar/protocol/CellocatorProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/CellocatorProtocolDecoder.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java
index 970f0ee4c..655fadfbd 100644
--- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java
+++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java
@@ -122,14 +122,14 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte()));
buf.readUnsignedByte(); // mode
- buf.readUnsignedInt(); // IO
+ buf.readUnsignedInt(); // io
operator <<= 8;
operator += buf.readUnsignedByte();
position.set("operator", operator);
- buf.readUnsignedInt(); // ADC
- buf.readUnsignedMedium(); // Odometer
+ buf.readUnsignedInt(); // adc
+ buf.readUnsignedMedium(); // odometer
buf.skipBytes(6); // multi-purpose data
buf.readUnsignedShort(); // gps fix
@@ -137,10 +137,9 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // mode 1
buf.readUnsignedByte(); // mode 2
- int satellites = buf.readUnsignedByte();
- position.setValid(satellites >= 3);
- position.set(Position.KEY_SATELLITES, satellites);
+ position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
+ position.setValid(true);
position.setLongitude(buf.readInt() / Math.PI * 180 / 100000000);
position.setLatitude(buf.readInt() / Math.PI * 180 / 100000000.0);
position.setAltitude(buf.readInt() * 0.01);