diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java index a3ceb4f30..d375730bf 100644 --- a/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java @@ -1,3 +1,4 @@ + /* * Copyright 2015 - 2019 Anton Tananaev (anton@traccar.org) * @@ -69,15 +70,16 @@ public class Gt06ProtocolEncoder extends BaseProtocolEncoder { boolean alternative = Context.getIdentityManager().lookupAttributeBoolean( command.getDeviceId(), getProtocolName() + ".alternative", false, false, true); - initDevicePassword(command, "123456"); + String password = Context.getIdentityManager() + .getDevicePassword(command.getDeviceId(), getProtocolName(), "123456"); switch (command.getType()) { case Command.TYPE_ENGINE_STOP: return encodeContent(command.getDeviceId(), - alternative ? "DYD," + Command.KEY_DEVICE_PASSWORD + "#" : "Relay,1#"); + alternative ? "DYD," + password + "#" : "Relay,1#"); case Command.TYPE_ENGINE_RESUME: return encodeContent(command.getDeviceId(), - alternative ? "HFYD," + Command.KEY_DEVICE_PASSWORD + "#" : "Relay,0#"); + alternative ? "HFYD," + password + "#" : "Relay,0#"); case Command.TYPE_CUSTOM: return encodeContent(command.getDeviceId(), command.getString(Command.KEY_DATA)); default: |