diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 1 | ||||
-rw-r--r-- | src/org/traccar/database/IdentityManager.java | 8 | ||||
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolEncoder.java | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 8337762f7..0c5f458a2 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -547,4 +547,5 @@ public class DataManager { .setLong("managedUserId", managedUserId) .executeUpdate(); } + } diff --git a/src/org/traccar/database/IdentityManager.java b/src/org/traccar/database/IdentityManager.java index db8e9c1c7..c8c593a54 100644 --- a/src/org/traccar/database/IdentityManager.java +++ b/src/org/traccar/database/IdentityManager.java @@ -28,4 +28,12 @@ public interface IdentityManager { boolean isLatestPosition(Position position); + boolean lookupAttributeBoolean(long deviceId, String attributeName, boolean defaultValue, boolean lookupConfig); + + String lookupAttributeString(long deviceId, String attributeName, String defaultValue, boolean lookupConfig); + + int lookupAttributeInteger(long deviceId, String attributeName, int defaultValue, boolean lookupConfig); + + long lookupAttributeLong(long deviceId, String attributeName, long defaultValue, boolean lookupConfig); + } diff --git a/src/org/traccar/protocol/Gt06ProtocolEncoder.java b/src/org/traccar/protocol/Gt06ProtocolEncoder.java index c20e1108f..7298f0ff6 100644 --- a/src/org/traccar/protocol/Gt06ProtocolEncoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolEncoder.java @@ -22,7 +22,6 @@ import org.traccar.Context; import org.traccar.helper.Checksum; import org.traccar.helper.Log; import org.traccar.model.Command; -import org.traccar.model.Device; import java.nio.charset.StandardCharsets; @@ -56,7 +55,7 @@ public class Gt06ProtocolEncoder extends BaseProtocolEncoder { @Override protected Object encodeCommand(Command command) { - boolean alternative = Context.getDeviceManager().lookupAttributeBoolean( + boolean alternative = Context.getIdentityManager().lookupAttributeBoolean( command.getDeviceId(), "gt06.alternative", false, true); switch (command.getType()) { |