diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-22 19:33:56 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-22 19:33:56 +1300 |
commit | 58ade656e2070387f95984f5851cbc41990467ba (patch) | |
tree | 7ed9c8e095ad6bd57098f214c5749475853bbac4 /src/org/traccar/protocol/Gt06ProtocolDecoder.java | |
parent | 68b2d3ab8897114dac8cd92618cf0777f630750a (diff) | |
download | trackermap-server-58ade656e2070387f95984f5851cbc41990467ba.tar.gz trackermap-server-58ade656e2070387f95984f5851cbc41990467ba.tar.bz2 trackermap-server-58ade656e2070387f95984f5851cbc41990467ba.zip |
Add new position constructor
Diffstat (limited to 'src/org/traccar/protocol/Gt06ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 37f64ee02..d6cc2fa86 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -415,9 +415,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { } else if (type == MSG_HEARTBEAT) { - Position position = new Position(); + Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - position.setProtocol(getProtocolName()); getLastLocation(position, null); @@ -453,9 +452,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { } else if (type == MSG_X1_GPS) { - Position position = new Position(); + Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - position.setProtocol(getProtocolName()); buf.readUnsignedInt(); // data and alarm @@ -501,9 +499,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { private Object decodeWifi(ChannelBuffer buf, DeviceSession deviceSession) throws Exception { - Position position = new Position(); + Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - position.setProtocol(getProtocolName()); DateBuilder dateBuilder = new DateBuilder() .setYear(BcdUtil.readInteger(buf, 2)) @@ -540,9 +537,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { private Object decodeBasicOther(Channel channel, ChannelBuffer buf, DeviceSession deviceSession, int type, int dataLength) throws Exception { - Position position = new Position(); + Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - position.setProtocol(getProtocolName()); if (type == MSG_LBS_MULTIPLE || type == MSG_LBS_EXTEND || type == MSG_LBS_WIFI || type == MSG_LBS_2 || type == MSG_WIFI_3) { @@ -648,9 +644,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { return null; } - Position position = new Position(); + Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - position.setProtocol(getProtocolName()); buf.readUnsignedShort(); // length int type = buf.readUnsignedByte(); |