From ff3cf10de072d4ee522447b05278d8c2f029a034 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 21 Dec 2016 17:27:48 +1300 Subject: Implement GT06 LBS extended support (fix #2690) --- src/org/traccar/protocol/Gt06ProtocolDecoder.java | 26 ++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 9a3efa553..59c301186 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -235,7 +235,31 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { return null; } - if (type == MSG_STRING) { + if (type == MSG_LBS_EXTEND) { + + Position position = new Position(); + position.setDeviceId(deviceSession.getDeviceId()); + position.setProtocol(getProtocolName()); + + DateBuilder dateBuilder = new DateBuilder(timeZone) + .setDate(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte()) + .setTime(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte()); + + getLastLocation(position, dateBuilder.getDate()); + + int mcc = buf.readUnsignedShort(); + int mnc = buf.readUnsignedByte(); + + Network network = new Network(); + for (int i = 0; i < 7; i++) { + network.addCellTower(CellTower.from( + mcc, mnc, buf.readUnsignedShort(), buf.readUnsignedMedium(), -buf.readUnsignedByte())); + } + position.setNetwork(network); + + return position; + + } if (type == MSG_STRING) { Position position = new Position(); position.setDeviceId(deviceSession.getDeviceId()); -- cgit v1.2.3