aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/MeiligaoProtocolEncoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-18 10:27:24 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-18 10:27:24 -0700
commit97a189c51817a6b1d7a86aece8a91ff378488799 (patch)
tree9f47127dafa956ae6a8f98c818a9fbcef5432a5b /src/main/java/org/traccar/protocol/MeiligaoProtocolEncoder.java
parent22bd8bcc80b850dc2308be50cf2886c39b0655da (diff)
downloadtrackermap-server-97a189c51817a6b1d7a86aece8a91ff378488799.tar.gz
trackermap-server-97a189c51817a6b1d7a86aece8a91ff378488799.tar.bz2
trackermap-server-97a189c51817a6b1d7a86aece8a91ff378488799.zip
Refactor attribute lookup
Diffstat (limited to 'src/main/java/org/traccar/protocol/MeiligaoProtocolEncoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/MeiligaoProtocolEncoder.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/MeiligaoProtocolEncoder.java b/src/main/java/org/traccar/protocol/MeiligaoProtocolEncoder.java
index 7784ab093..21f9f8801 100644
--- a/src/main/java/org/traccar/protocol/MeiligaoProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/MeiligaoProtocolEncoder.java
@@ -19,8 +19,10 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.traccar.BaseProtocolEncoder;
import org.traccar.Protocol;
+import org.traccar.config.Keys;
import org.traccar.helper.Checksum;
import org.traccar.helper.DataConverter;
+import org.traccar.helper.model.AttributeUtil;
import org.traccar.model.Command;
import java.nio.charset.StandardCharsets;
@@ -58,8 +60,8 @@ public class MeiligaoProtocolEncoder extends BaseProtocolEncoder {
@Override
protected Object encodeCommand(Command command) {
- boolean alternative = getIdentityManager().lookupAttributeBoolean(
- command.getDeviceId(), getProtocolName() + ".alternative", false, false, true);
+ boolean alternative = AttributeUtil.lookup(
+ getCacheManager(), Keys.PROTOCOL_ALTERNATIVE.withPrefix(getProtocolName()), command.getDeviceId());
int outputControlMessageType = alternative
? MeiligaoProtocolDecoder.MSG_OUTPUT_CONTROL_1