revert cli changes before apply of new ones

This commit is contained in:
MX
2025-04-05 23:40:13 +03:00
parent c9201a3bde
commit 380402a55c
17 changed files with 61 additions and 201 deletions

View File

@@ -4,10 +4,6 @@
#include <furi_hal_version.h>
#include <loader/loader.h>
#include <flipper_application/plugins/plugin_manager.h>
#include <loader/firmware_api/firmware_api.h>
#include <inttypes.h>
#define TAG "CliSrv"
#define CLI_INPUT_LEN_LIMIT 256
@@ -486,19 +482,3 @@ int32_t cli_srv(void* p) {
return 0;
}
void cli_plugin_wrapper(const char* name, Cli* cli, FuriString* args, void* context) {
PluginManager* manager =
plugin_manager_alloc(CLI_PLUGIN_APP_ID, CLI_PLUGIN_API_VERSION, firmware_api_interface);
FuriString* path =
furi_string_alloc_printf(EXT_PATH("apps_data/cli/plugins/%s_cli.fal"), name);
PluginManagerError error = plugin_manager_load_single(manager, furi_string_get_cstr(path));
if(error == PluginManagerErrorNone) {
const CliCallback handler = plugin_manager_get_ep(manager, 0);
handler(cli, args, context);
} else {
printf("CLI plugin failed (code %" PRIu16 "), update firmware or check logs\r\n", error);
}
furi_string_free(path);
plugin_manager_free(manager);
}

View File

@@ -63,13 +63,6 @@ void cli_putc(Cli* cli, char c);
void cli_stdout_callback(void* _cookie, const char* data, size_t size);
// Wraps CLI commands to load from plugin file
// Must call from CLI context, like dummy CLI command callback
// You need to setup the plugin to compile correctly separately
#define CLI_PLUGIN_APP_ID "cli"
#define CLI_PLUGIN_API_VERSION 1
void cli_plugin_wrapper(const char* name, Cli* cli, FuriString* args, void* context);
#ifdef __cplusplus
}
#endif