aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/CellocatorProtocolDecoder.java
diff options
context:
space:
mode:
authorjon-stumpf <jon.stumpf@gmail.com>2017-02-25 20:50:12 -0500
committerjon-stumpf <jon.stumpf@gmail.com>2017-03-04 15:57:37 -0500
commit96ad8262428107025ff3f5cde165cc53117acca4 (patch)
tree2a89e5c3036b7f419a8125e0328186f15ecfdb39 /src/org/traccar/protocol/CellocatorProtocolDecoder.java
parent44a6a0ac96d4925eb0c29bcbcd1807d9176dfa04 (diff)
downloadtrackermap-server-96ad8262428107025ff3f5cde165cc53117acca4.tar.gz
trackermap-server-96ad8262428107025ff3f5cde165cc53117acca4.tar.bz2
trackermap-server-96ad8262428107025ff3f5cde165cc53117acca4.zip
Updated protocols to record additional information as reported in comments and confirmed in available documentation;
Diffstat (limited to 'src/org/traccar/protocol/CellocatorProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/CellocatorProtocolDecoder.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java
index 655fadfbd..c0f871f80 100644
--- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java
+++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java
@@ -109,9 +109,9 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
}
position.setDeviceId(deviceSession.getDeviceId());
- buf.readUnsignedByte(); // hardware version
- buf.readUnsignedByte(); // software version
- buf.readUnsignedByte(); // protocol version
+ position.set(Position.KEY_VERSION_HW, buf.readUnsignedByte()); // hardware version
+ position.set(Position.KEY_VERSION_FW, buf.readUnsignedByte()); // software version
+ position.set("protocolVersion", buf.readUnsignedByte()); // protocol version
position.set(Position.KEY_STATUS, buf.getUnsignedByte(buf.readerIndex()) & 0x0f);
@@ -121,21 +121,21 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // reason data
position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte()));
- buf.readUnsignedByte(); // mode
- buf.readUnsignedInt(); // io
+ position.set("mode", buf.readUnsignedByte()); // mode
+ position.set(Position.PREFIX_IO + 1, buf.readUnsignedInt()); // IO
operator <<= 8;
operator += buf.readUnsignedByte();
position.set("operator", operator);
- buf.readUnsignedInt(); // adc
- buf.readUnsignedMedium(); // odometer
+ position.set(Position.PREFIX_ADC + 1, buf.readUnsignedInt()); // ADC
+ position.set(Position.KEY_ODOMETER, buf.readUnsignedMedium()); // Odometer
buf.skipBytes(6); // multi-purpose data
- buf.readUnsignedShort(); // gps fix
- buf.readUnsignedByte(); // location status
- buf.readUnsignedByte(); // mode 1
- buf.readUnsignedByte(); // mode 2
+ position.set(Position.KEY_GPS, buf.readUnsignedShort()); // gps fix
+ position.set("locationStatus", buf.readUnsignedByte()); // location status
+ position.set("mode1", buf.readUnsignedByte()); // mode 1
+ position.set("mode2", buf.readUnsignedByte()); // mode 2
position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());