diff options
Diffstat (limited to 'src/org/traccar/protocol/Gl200ProtocolEncoder.java')
-rw-r--r-- | src/org/traccar/protocol/Gl200ProtocolEncoder.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolEncoder.java b/src/org/traccar/protocol/Gl200ProtocolEncoder.java index 0537420a0..2c8efa318 100644 --- a/src/org/traccar/protocol/Gl200ProtocolEncoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,15 +24,21 @@ public class Gl200ProtocolEncoder extends StringProtocolEncoder { @Override protected Object encodeCommand(Command command) { + initDevicePassword(command, ""); + switch (command.getType()) { case Command.TYPE_POSITION_SINGLE: - return "AT+GTRTO=gv300,1,,,,,,FFFF$"; + return formatCommand(command, "AT+GTRTO={%s},1,,,,,,FFFF$", Command.KEY_DEVICE_PASSWORD); case Command.TYPE_ENGINE_STOP: - return "AT+GTOUT=gv300,1,,,0,0,0,0,0,0,0,,,,,,,FFFF$"; + return formatCommand(command, "AT+GTOUT={%s},1,,,0,0,0,0,0,0,0,,,,,,,FFFF$", + Command.KEY_DEVICE_PASSWORD); case Command.TYPE_ENGINE_RESUME: - return "AT+GTOUT=gv300,0,,,0,0,0,0,0,0,0,,,,,,,FFFF$"; + return formatCommand(command, "AT+GTOUT={%s},0,,,0,0,0,0,0,0,0,,,,,,,FFFF$", + Command.KEY_DEVICE_PASSWORD); + case Command.TYPE_IDENTIFICATION: + return formatCommand(command, "AT+GTRTO={%s},8,,,,,,FFFF$", Command.KEY_DEVICE_PASSWORD); case Command.TYPE_REBOOT_DEVICE: - return "AT+GTRTO=gv300,3,,,,,,FFFF$"; + return formatCommand(command, "AT+GTRTO={%s},3,,,,,,FFFF$", Command.KEY_DEVICE_PASSWORD); default: Log.warning(new UnsupportedOperationException(command.getType())); break; |