diff options
Diffstat (limited to 'src/org/traccar/protocol/CellocatorProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/CellocatorProtocolDecoder.java | 22 |
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()); |