diff options
author | edvalley <52469633+edvalley@users.noreply.github.com> | 2023-07-09 16:06:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-09 16:06:18 -0400 |
commit | 7ade92a97f41951aecfbb9de720780cf5232e2c1 (patch) | |
tree | b8b20c3b9d539c183337f9dda44f5d829724bbb1 | |
parent | e63b6bd4868f367c581db40997f741d00587b3b2 (diff) | |
download | trackermap-server-7ade92a97f41951aecfbb9de720780cf5232e2c1.tar.gz trackermap-server-7ade92a97f41951aecfbb9de720780cf5232e2c1.tar.bz2 trackermap-server-7ade92a97f41951aecfbb9de720780cf5232e2c1.zip |
Fix more errors
-rw-r--r-- | src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java b/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java index e3409c85a..f0753cb5c 100644 --- a/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java @@ -220,22 +220,21 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder { return null; } - String deviceId = parser.next(); - DeviceSession deviceSession = - getDeviceSession(channel, remoteAddress, deviceId); + getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } String deviceModel = null; - Device device = getCacheManager().getObject(Device.class, deviceId); + Device device = getCacheManager().getObject(Device.class, deviceSession.getDeviceId()); if (device != null) { deviceModel = device.getModel(); } Position position = new Position(getProtocolName()); - position.setDeviceId(deviceId); + + position.setDeviceId(deviceSession.getDeviceId()); DateBuilder dateBuilder = new DateBuilder() .setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0)); @@ -281,7 +280,7 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder { sendAcknowledge(status, event, checksum, channel, remoteAddress); String devicePassword = AttributeUtil.getDevicePassword( - getCacheManager(), deviceId, getProtocolName(), DEFAULT_DEVICE_PASSWORD); + getCacheManager(), deviceSession.getDeviceId(), getProtocolName(), DEFAULT_DEVICE_PASSWORD); sendEventResponse(event, devicePassword, channel, remoteAddress); } |