aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/EelinkProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/EelinkProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/EelinkProtocolDecoder.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java
index 98a9f7d6d..0ed81c925 100644
--- a/src/org/traccar/protocol/EelinkProtocolDecoder.java
+++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java
@@ -115,9 +115,8 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
private Position decodeOld(DeviceSession deviceSession, ChannelBuffer buf, int type, int index) {
- Position position = new Position();
+ Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
- position.setProtocol(getProtocolName());
position.set(Position.KEY_INDEX, index);
@@ -173,9 +172,8 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
private Position decodeNew(DeviceSession deviceSession, ChannelBuffer buf, int index) {
- Position position = new Position();
+ Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
- position.setProtocol(getProtocolName());
position.set(Position.KEY_INDEX, index);
@@ -282,9 +280,8 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
private Position decodeResult(DeviceSession deviceSession, ChannelBuffer buf, int index) {
- Position position = new Position();
+ Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
- position.setProtocol(getProtocolName());
position.set(Position.KEY_INDEX, index);
@@ -362,9 +359,8 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
} else if (type == MSG_HEARTBEAT && buf.readableBytes() >= 2) {
- Position position = new Position();
+ Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
- position.setProtocol(getProtocolName());
getLastLocation(position, null);