aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MeitrackProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/MeitrackProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MeitrackProtocolDecoder.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java
index b0195d09f..11e38194f 100644
--- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java
@@ -126,8 +126,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- Position position = new Position();
- position.setProtocol(getProtocolName());
+ Position position = new Position(getProtocolName());
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
if (deviceSession == null) {
@@ -287,8 +286,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
while (buf.readableBytes() >= 0x34) {
- Position position = new Position();
- position.setProtocol(getProtocolName());
+ Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
position.set(Position.KEY_EVENT, buf.readUnsignedByte());
@@ -361,8 +359,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
int count = buf.readUnsignedShort();
for (int i = 0; i < count; i++) {
- Position position = new Position();
- position.setProtocol(getProtocolName());
+ Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
buf.readUnsignedShort(); // length
@@ -475,8 +472,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
photo.writeBytes(buf.readBytes(buf.readableBytes() - 1 - 2 - 2));
if (current == total - 1) {
- Position position = new Position();
- position.setProtocol(getProtocolName());
+ Position position = new Position(getProtocolName());
position.setDeviceId(getDeviceSession(channel, remoteAddress, imei).getDeviceId());
getLastLocation(position, null);