aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/TzoneProtocolDecoder.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/TzoneProtocolDecoder.java
parentb7e53f57689e1f8a1c0705aeea32dc6e69f3fcb3 (diff)
parentf94613b97cf80af64154ae571920a273771fa1d3 (diff)
downloadtrackermap-server-e3a3f06cc07bc5d75d3d670e045abb5d6c91fcad.tar.gz
trackermap-server-e3a3f06cc07bc5d75d3d670e045abb5d6c91fcad.tar.bz2
trackermap-server-e3a3f06cc07bc5d75d3d670e045abb5d6c91fcad.zip
Merge pull request #2979 from jon-stumpf/jss-add-info
Additional Protocol Information
Diffstat (limited to 'src/org/traccar/protocol/TzoneProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/TzoneProtocolDecoder.java11
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());