From 64b2d09ecc58ba68eea39fdb538f22accf386e72 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 13 Jan 2024 08:14:29 -0800 Subject: Add Minifinder config command --- src/main/java/org/traccar/protocol/Minifinder2Protocol.java | 3 ++- src/main/java/org/traccar/protocol/Minifinder2ProtocolEncoder.java | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/traccar') 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(); -- cgit v1.2.3