aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/CellocatorProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-03-08 19:14:23 +1300
committerGitHub <noreply@github.com>2017-03-08 19:14:23 +1300
commite3a3f06cc07bc5d75d3d670e045abb5d6c91fcad (patch)
treeee424dc1b6b86abb54abcc5fe4f2068ac0cbf286 /src/org/traccar/protocol/CellocatorProtocolDecoder.java
parentb7e53f57689e1f8a1c0705aeea32dc6e69f3fcb3 (diff)
parentf94613b97cf80af64154ae571920a273771fa1d3 (diff)
downloadtraccar-server-e3a3f06cc07bc5d75d3d670e045abb5d6c91fcad.tar.gz
traccar-server-e3a3f06cc07bc5d75d3d670e045abb5d6c91fcad.tar.bz2
traccar-server-e3a3f06cc07bc5d75d3d670e045abb5d6c91fcad.zip
Merge pull request #2979 from jon-stumpf/jss-add-info
Additional Protocol Information
Diffstat (limited to 'src/org/traccar/protocol/CellocatorProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/CellocatorProtocolDecoder.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java
index 655fadfbd..2b4fa9fb6 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());
+ position.set(Position.KEY_VERSION_FW, buf.readUnsignedByte());
+ position.set("protocolVersion", buf.readUnsignedByte());
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());
+ position.set(Position.PREFIX_IO + 1, buf.readUnsignedInt());
operator <<= 8;
operator += buf.readUnsignedByte();
- position.set("operator", operator);
+ position.set(Position.KEY_OPERATOR, operator);
- buf.readUnsignedInt(); // adc
- buf.readUnsignedMedium(); // odometer
+ position.set(Position.PREFIX_ADC + 1, buf.readUnsignedInt());
+ position.set(Position.KEY_ODOMETER, buf.readUnsignedMedium());
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());
+ position.set("locationStatus", buf.readUnsignedByte());
+ position.set("mode1", buf.readUnsignedByte());
+ position.set("mode2", buf.readUnsignedByte());
position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());