diff options
Diffstat (limited to 'src/org/traccar/BaseProtocol.java')
-rw-r--r-- | src/org/traccar/BaseProtocol.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/BaseProtocol.java b/src/org/traccar/BaseProtocol.java index 4e5df329c..a78143167 100644 --- a/src/org/traccar/BaseProtocol.java +++ b/src/org/traccar/BaseProtocol.java @@ -16,6 +16,7 @@ package org.traccar; import io.netty.buffer.Unpooled; +import io.netty.handler.codec.string.StringEncoder; import org.traccar.database.ActiveDevice; import org.traccar.helper.DataConverter; import org.traccar.model.Command; @@ -75,7 +76,7 @@ public abstract class BaseProtocol implements Protocol { activeDevice.write(command); } else if (command.getType().equals(Command.TYPE_CUSTOM)) { String data = command.getString(Command.KEY_DATA); - if (activeDevice.getChannel().pipeline().get("stringEncoder") != null) { + if (activeDevice.getChannel().pipeline().get(StringEncoder.class) != null) { activeDevice.write(data); } else { activeDevice.write(Unpooled.wrappedBuffer(DataConverter.parseHex(data))); |