diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-07-18 09:26:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-18 09:26:27 -0700 |
commit | 509d26db7efafe965f5cc6e1a1fba6b30e9556cf (patch) | |
tree | a24039c2610bcb59f0af18b6e534787828185abd /src/main/java/org/traccar/protocol | |
parent | bba38f9078a1c1455730daf80d76587cf21228cc (diff) | |
parent | f4bef0008fc6b2562a29017e6eb4272734943311 (diff) | |
download | trackermap-server-509d26db7efafe965f5cc6e1a1fba6b30e9556cf.tar.gz trackermap-server-509d26db7efafe965f5cc6e1a1fba6b30e9556cf.tar.bz2 trackermap-server-509d26db7efafe965f5cc6e1a1fba6b30e9556cf.zip |
Merge pull request #4357 from edvalley/proposed2
Make optional server attributes lookup
Diffstat (limited to 'src/main/java/org/traccar/protocol')
7 files changed, 13 insertions, 12 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java index 2fb18d2a2..bbc5e02d8 100644 --- a/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java @@ -33,7 +33,8 @@ public class Gt06ProtocolEncoder extends BaseProtocolEncoder { private ByteBuf encodeContent(long deviceId, String content) { - boolean language = Context.getIdentityManager().lookupAttributeBoolean(deviceId, "gt06.language", false, true); + boolean language = Context.getIdentityManager() + .lookupAttributeBoolean(deviceId, "gt06.language", false, false, true); ByteBuf buf = Unpooled.buffer(); @@ -66,7 +67,7 @@ public class Gt06ProtocolEncoder extends BaseProtocolEncoder { protected Object encodeCommand(Command command) { boolean alternative = Context.getIdentityManager().lookupAttributeBoolean( - command.getDeviceId(), "gt06.alternative", false, true); + command.getDeviceId(), "gt06.alternative", false, false, true); switch (command.getType()) { case Command.TYPE_ENGINE_STOP: diff --git a/src/main/java/org/traccar/protocol/H02ProtocolEncoder.java b/src/main/java/org/traccar/protocol/H02ProtocolEncoder.java index 3dbdf879e..024899abb 100644 --- a/src/main/java/org/traccar/protocol/H02ProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/H02ProtocolEncoder.java @@ -60,7 +60,7 @@ public class H02ProtocolEncoder extends StringProtocolEncoder { case Command.TYPE_POSITION_PERIODIC: String frequency = command.getAttributes().get(Command.KEY_FREQUENCY).toString(); if (Context.getIdentityManager().lookupAttributeBoolean( - command.getDeviceId(), "h02.alternative", false, true)) { + command.getDeviceId(), "h02.alternative", false, false, true)) { return formatCommand(time, uniqueId, "D1", frequency); } else { return formatCommand(time, uniqueId, "S71", "22", frequency); diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolEncoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolEncoder.java index 2038c8d48..c493b49fe 100644 --- a/src/main/java/org/traccar/protocol/HuabaoProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/HuabaoProtocolEncoder.java @@ -36,7 +36,7 @@ public class HuabaoProtocolEncoder extends BaseProtocolEncoder { protected Object encodeCommand(Command command) { boolean alternative = Context.getIdentityManager().lookupAttributeBoolean( - command.getDeviceId(), "huabao.alternative", false, true); + command.getDeviceId(), "huabao.alternative", false, false, true); ByteBuf id = Unpooled.wrappedBuffer( DataConverter.parseHex(getUniqueId(command.getDeviceId()))); diff --git a/src/main/java/org/traccar/protocol/MeitrackProtocolEncoder.java b/src/main/java/org/traccar/protocol/MeitrackProtocolEncoder.java index a0dc95c5d..4db404ecf 100644 --- a/src/main/java/org/traccar/protocol/MeitrackProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/MeitrackProtocolEncoder.java @@ -43,7 +43,7 @@ public class MeitrackProtocolEncoder extends StringProtocolEncoder { Map<String, Object> attributes = command.getAttributes(); boolean alternative = Context.getIdentityManager().lookupAttributeBoolean( - command.getDeviceId(), "meitrack.alternative", false, true); + command.getDeviceId(), "meitrack.alternative", false, false, true); switch (command.getType()) { case Command.TYPE_POSITION_SINGLE: diff --git a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java index c469be442..e40096a77 100644 --- a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java @@ -50,7 +50,7 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { public int getProtocolType(long deviceId) { return Context.getIdentityManager().lookupAttributeInteger( - deviceId, getProtocolName() + ".protocolType", protocolType, true); + deviceId, getProtocolName() + ".protocolType", protocolType, false, true); } public void setHbm(boolean hbm) { @@ -59,7 +59,7 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { public boolean isHbm(long deviceId) { return Context.getIdentityManager().lookupAttributeBoolean( - deviceId, getProtocolName() + ".hbm", hbm, true); + deviceId, getProtocolName() + ".hbm", hbm, false, true); } public void setIncludeAdc(boolean includeAdc) { @@ -68,7 +68,7 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { public boolean isIncludeAdc(long deviceId) { return Context.getIdentityManager().lookupAttributeBoolean( - deviceId, getProtocolName() + ".includeAdc", includeAdc, true); + deviceId, getProtocolName() + ".includeAdc", includeAdc, false, true); } public void setIncludeRpm(boolean includeRpm) { @@ -77,7 +77,7 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { public boolean isIncludeRpm(long deviceId) { return Context.getIdentityManager().lookupAttributeBoolean( - deviceId, getProtocolName() + ".includeRpm", includeRpm, true); + deviceId, getProtocolName() + ".includeRpm", includeRpm, false, true); } public void setIncludeTemp(boolean includeTemp) { @@ -86,7 +86,7 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { public boolean isIncludeTemp(long deviceId) { return Context.getIdentityManager().lookupAttributeBoolean( - deviceId, getProtocolName() + ".includeTemp", includeTemp, true); + deviceId, getProtocolName() + ".includeTemp", includeTemp, false, true); } private Position decode9( diff --git a/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java b/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java index ba231a635..e25f9e11a 100644 --- a/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java @@ -103,7 +103,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { if (deviceSession != null && channel != null && !(channel instanceof DatagramChannel) && Context.getIdentityManager().lookupAttributeBoolean( - deviceSession.getDeviceId(), getProtocolName() + ".ack", false, true)) { + deviceSession.getDeviceId(), getProtocolName() + ".ack", false, false, true)) { channel.writeAndFlush(new NetworkMessage("OK1\r\n", remoteAddress)); } diff --git a/src/main/java/org/traccar/protocol/Tk103ProtocolEncoder.java b/src/main/java/org/traccar/protocol/Tk103ProtocolEncoder.java index cc79968b7..f21c5a3ae 100644 --- a/src/main/java/org/traccar/protocol/Tk103ProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/Tk103ProtocolEncoder.java @@ -43,7 +43,7 @@ public class Tk103ProtocolEncoder extends StringProtocolEncoder { protected Object encodeCommand(Command command) { boolean alternative = forceAlternative || Context.getIdentityManager().lookupAttributeBoolean( - command.getDeviceId(), "tk103.alternative", false, true); + command.getDeviceId(), "tk103.alternative", false, false, true); initDevicePassword(command, "123456"); |