mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 16:48:35 -07:00
(Experimental) External CLI plugins -29kb DFU
Idea and plugin loader implementation by @akopachov, thanks! All commands done except storage and rpc for latency reasons
This commit is contained in:
@@ -14,14 +14,23 @@ App(
|
||||
)
|
||||
|
||||
App(
|
||||
appid="infrared_start",
|
||||
apptype=FlipperAppType.STARTUP,
|
||||
appid="infrared_cli",
|
||||
targets=["f7"],
|
||||
entry_point="infrared_on_system_start",
|
||||
apptype=FlipperAppType.PLUGIN,
|
||||
entry_point="infrared_cli_plugin_ep",
|
||||
requires=["cli"],
|
||||
sources=[
|
||||
"infrared_cli.c",
|
||||
"infrared_brute_force.c",
|
||||
"infrared_signal.c",
|
||||
],
|
||||
)
|
||||
|
||||
App(
|
||||
appid="infrared_start",
|
||||
apptype=FlipperAppType.STARTUP,
|
||||
targets=["f7"],
|
||||
entry_point="infrared_on_system_start",
|
||||
sources=["infrared_start.c"],
|
||||
order=20,
|
||||
)
|
||||
|
||||
@@ -544,12 +544,15 @@ static void infrared_cli_start_ir(Cli* cli, FuriString* args, void* context) {
|
||||
|
||||
furi_string_free(command);
|
||||
}
|
||||
void infrared_on_system_start() {
|
||||
#ifdef SRV_CLI
|
||||
Cli* cli = (Cli*)furi_record_open(RECORD_CLI);
|
||||
cli_add_command(cli, "ir", CliCommandFlagDefault, infrared_cli_start_ir, NULL);
|
||||
furi_record_close(RECORD_CLI);
|
||||
#else
|
||||
UNUSED(infrared_cli_start_ir);
|
||||
#endif
|
||||
|
||||
#include <flipper_application/flipper_application.h>
|
||||
|
||||
static const FlipperAppPluginDescriptor plugin_descriptor = {
|
||||
.appid = "infrared_cli",
|
||||
.ep_api_version = 1,
|
||||
.entry_point = &infrared_cli_start_ir,
|
||||
};
|
||||
|
||||
const FlipperAppPluginDescriptor* infrared_cli_plugin_ep() {
|
||||
return &plugin_descriptor;
|
||||
}
|
||||
|
||||
11
applications/main/infrared/infrared_start.c
Normal file
11
applications/main/infrared/infrared_start.c
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <cli/cli_i.h>
|
||||
|
||||
static void infrared_cli_start_ir_wrapper(Cli* cli, FuriString* args, void* context) {
|
||||
cli_plugin_wrapper("infrared_cli", 1, cli, args, context);
|
||||
}
|
||||
|
||||
void infrared_on_system_start() {
|
||||
Cli* cli = (Cli*)furi_record_open(RECORD_CLI);
|
||||
cli_add_command(cli, "ir", CliCommandFlagDefault, infrared_cli_start_ir_wrapper, NULL);
|
||||
furi_record_close(RECORD_CLI);
|
||||
}
|
||||
Reference in New Issue
Block a user