aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-11-23 18:11:56 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-11-23 18:11:56 -0800
commitf1a283153c790434087a6b5011e7a50c78a5ad55 (patch)
tree7e63ade6693ee75eb4eefd17fe8bc9d333162afb /src/main
parent05e44d8cf956f6a0d44497aa0b357036139425dd (diff)
downloadtraccar-server-f1a283153c790434087a6b5011e7a50c78a5ad55.tar.gz
traccar-server-f1a283153c790434087a6b5011e7a50c78a5ad55.tar.bz2
traccar-server-f1a283153c790434087a6b5011e7a50c78a5ad55.zip
Decode additional attributes
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index 6711fe0fd..b51da00d7 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -1020,7 +1020,28 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
while (buf.readableBytes() > 6) {
int moduleType = buf.readUnsignedShort();
int moduleLength = buf.readUnsignedShort();
+
switch (moduleType) {
+ case 0x03:
+ position.set(Position.KEY_ICCID, ByteBufUtil.hexDump(buf.readSlice(10)));
+ break;
+ case 0x09:
+ position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
+ break;
+ case 0x0a:
+ position.set(Position.KEY_SATELLITES_VISIBLE, buf.readUnsignedByte());
+ break;
+ case 0x11:
+ CellTower cellTower = CellTower.from(
+ buf.readUnsignedShort(),
+ buf.readUnsignedShort(),
+ buf.readUnsignedShort(),
+ buf.readUnsignedMedium(),
+ buf.readUnsignedByte());
+ if (cellTower.getCellId() > 0) {
+ position.setNetwork(new Network(cellTower));
+ }
+ break;
case 0x18:
position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.01);
break;
@@ -1081,6 +1102,11 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
position.setLatitude(latitude);
position.setLongitude(longitude);
break;
+ case 0x34:
+ position.set(Position.KEY_EVENT, buf.readUnsignedByte());
+ buf.readUnsignedIntLE(); // time
+ buf.skipBytes(buf.readUnsignedByte()); // content
+ break;
default:
buf.skipBytes(moduleLength);
break;