diff options
author | Anton Tananaev <anton@traccar.org> | 2024-01-13 08:14:29 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-01-13 08:14:29 -0800 |
commit | 64b2d09ecc58ba68eea39fdb538f22accf386e72 (patch) | |
tree | 6cb32a17c420bc90d8420ed42bc5a5569c0b778f /src/main/java/org/traccar/protocol | |
parent | 346a860b0aae7097445aa5aa22f37a88d9d7955e (diff) | |
download | trackermap-server-64b2d09ecc58ba68eea39fdb538f22accf386e72.tar.gz trackermap-server-64b2d09ecc58ba68eea39fdb538f22accf386e72.tar.bz2 trackermap-server-64b2d09ecc58ba68eea39fdb538f22accf386e72.zip |
Add Minifinder config command
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r-- | src/main/java/org/traccar/protocol/Minifinder2Protocol.java | 3 | ||||
-rw-r--r-- | src/main/java/org/traccar/protocol/Minifinder2ProtocolEncoder.java | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Minifinder2Protocol.java b/src/main/java/org/traccar/protocol/Minifinder2Protocol.java index c12933b81..082b9146d 100644 --- a/src/main/java/org/traccar/protocol/Minifinder2Protocol.java +++ b/src/main/java/org/traccar/protocol/Minifinder2Protocol.java @@ -31,7 +31,8 @@ public class Minifinder2Protocol extends BaseProtocol { @Inject public Minifinder2Protocol(Config config) { setSupportedDataCommands( - Command.TYPE_FIRMWARE_UPDATE); + Command.TYPE_FIRMWARE_UPDATE, + Command.TYPE_CONFIGURATION); addServer(new TrackerServer(config, getName(), false) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline, Config config) { diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolEncoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolEncoder.java index fab3c3a6d..72ac9db4e 100644 --- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolEncoder.java @@ -48,6 +48,13 @@ public class Minifinder2ProtocolEncoder extends BaseProtocolEncoder { @Override protected Object encodeCommand(Command command) { + if (command.getType().equals(Command.TYPE_CONFIGURATION)) { + ByteBuf content = Unpooled.buffer(); + content.writeByte(Minifinder2ProtocolDecoder.MSG_CONFIGURATION); + content.writeByte(1); // length + content.writeByte(0xF0); // type + } + Device device = getCacheManager().getObject(Device.class, command.getDeviceId()); if ("Nano".equalsIgnoreCase(device.getModel())) { ByteBuf content = Unpooled.buffer(); |