diff options
author | Anton Tananaev <anton@traccar.org> | 2022-06-18 10:27:24 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-06-18 10:27:24 -0700 |
commit | 97a189c51817a6b1d7a86aece8a91ff378488799 (patch) | |
tree | 9f47127dafa956ae6a8f98c818a9fbcef5432a5b /src/main/java/org/traccar/protocol/H02ProtocolEncoder.java | |
parent | 22bd8bcc80b850dc2308be50cf2886c39b0655da (diff) | |
download | trackermap-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/H02ProtocolEncoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/H02ProtocolEncoder.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/H02ProtocolEncoder.java b/src/main/java/org/traccar/protocol/H02ProtocolEncoder.java index 7fca0f93e..86b8c80d4 100644 --- a/src/main/java/org/traccar/protocol/H02ProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/H02ProtocolEncoder.java @@ -18,6 +18,8 @@ package org.traccar.protocol; import org.traccar.Protocol; import org.traccar.StringProtocolEncoder; +import org.traccar.config.Keys; +import org.traccar.helper.model.AttributeUtil; import org.traccar.model.Command; import java.util.Date; @@ -58,8 +60,9 @@ public class H02ProtocolEncoder extends StringProtocolEncoder { return formatCommand(time, uniqueId, "S20", "1", "0"); case Command.TYPE_POSITION_PERIODIC: String frequency = command.getAttributes().get(Command.KEY_FREQUENCY).toString(); - if (getIdentityManager().lookupAttributeBoolean( - command.getDeviceId(), getProtocolName() + ".alternative", false, false, true)) { + if (AttributeUtil.lookup( + getCacheManager(), Keys.PROTOCOL_ALTERNATIVE.withPrefix(getProtocolName()), + command.getDeviceId())) { return formatCommand(time, uniqueId, "D1", frequency); } else { return formatCommand(time, uniqueId, "S71", "22", frequency); |