aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/TzoneProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/TzoneProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/TzoneProtocolDecoder.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/TzoneProtocolDecoder.java b/src/org/traccar/protocol/TzoneProtocolDecoder.java
index 0fc93a03c..7dc158579 100644
--- a/src/org/traccar/protocol/TzoneProtocolDecoder.java
+++ b/src/org/traccar/protocol/TzoneProtocolDecoder.java
@@ -120,7 +120,7 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder {
return null;
}
int hardware = buf.readUnsignedShort(); // model
- buf.readUnsignedInt(); // firmware
+ long firmware = buf.readUnsignedInt(); // firmware
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()); // terminal info
position.set(Position.PREFIX_IO + 1, buf.readUnsignedShort());
position.set(Position.KEY_RSSI, buf.readUnsignedByte());
- buf.readUnsignedByte(); // GSM status
+ position.set("gsmStatus", buf.readUnsignedByte()); // GSM status
position.set(Position.KEY_BATTERY, buf.readUnsignedShort());
position.set(Position.KEY_POWER, buf.readUnsignedShort());
position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort());