diff options
Diffstat (limited to 'src/org/traccar/protocol/TzoneProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/TzoneProtocolDecoder.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/TzoneProtocolDecoder.java b/src/org/traccar/protocol/TzoneProtocolDecoder.java index 0fc93a03c..69aa916df 100644 --- a/src/org/traccar/protocol/TzoneProtocolDecoder.java +++ b/src/org/traccar/protocol/TzoneProtocolDecoder.java @@ -119,8 +119,8 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder { if (buf.readUnsignedShort() != 0x2424) { return null; } - int hardware = buf.readUnsignedShort(); // model - buf.readUnsignedInt(); // firmware + int hardware = buf.readUnsignedShort(); + long firmware = buf.readUnsignedInt(); String imei = ChannelBuffers.hexDump(buf.readBytes(8)).substring(1); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, imei); @@ -132,6 +132,9 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); + position.set(Position.KEY_VERSION_HW, hardware); + position.set(Position.KEY_VERSION_FW, firmware); + position.setDeviceTime(new DateBuilder() .setDate(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte()) .setTime(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte()).getDate()); @@ -199,10 +202,10 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder { if (blockLength >= 13) { position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte())); - buf.readUnsignedByte(); // terminal info + position.set("terminalInfo", buf.readUnsignedByte()); position.set(Position.PREFIX_IO + 1, buf.readUnsignedShort()); position.set(Position.KEY_RSSI, buf.readUnsignedByte()); - buf.readUnsignedByte(); // GSM status + position.set("gsmStatus", buf.readUnsignedByte()); position.set(Position.KEY_BATTERY, buf.readUnsignedShort()); position.set(Position.KEY_POWER, buf.readUnsignedShort()); position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort()); |