mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 20:49:49 +04:00
revert cli changes before apply of new ones
This commit is contained in:
@@ -12,20 +12,11 @@ App(
|
|||||||
fap_category="iButton",
|
fap_category="iButton",
|
||||||
)
|
)
|
||||||
|
|
||||||
App(
|
|
||||||
appid="ibutton_cli",
|
|
||||||
targets=["f7"],
|
|
||||||
apptype=FlipperAppType.PLUGIN,
|
|
||||||
entry_point="ibutton_cli_plugin_ep",
|
|
||||||
requires=["cli"],
|
|
||||||
sources=["ibutton_cli.c"],
|
|
||||||
)
|
|
||||||
|
|
||||||
App(
|
App(
|
||||||
appid="ibutton_start",
|
appid="ibutton_start",
|
||||||
apptype=FlipperAppType.STARTUP,
|
apptype=FlipperAppType.STARTUP,
|
||||||
targets=["f7"],
|
targets=["f7"],
|
||||||
entry_point="ibutton_on_system_start",
|
entry_point="ibutton_on_system_start",
|
||||||
sources=["ibutton_start.c"],
|
sources=["ibutton_cli.c"],
|
||||||
order=60,
|
order=60,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,6 +8,19 @@
|
|||||||
#include <ibutton/ibutton_worker.h>
|
#include <ibutton/ibutton_worker.h>
|
||||||
#include <ibutton/ibutton_protocols.h>
|
#include <ibutton/ibutton_protocols.h>
|
||||||
|
|
||||||
|
static void ibutton_cli(Cli* cli, FuriString* args, void* context);
|
||||||
|
|
||||||
|
// app cli function
|
||||||
|
void ibutton_on_system_start(void) {
|
||||||
|
#ifdef SRV_CLI
|
||||||
|
Cli* cli = furi_record_open(RECORD_CLI);
|
||||||
|
cli_add_command(cli, "ikey", CliCommandFlagDefault, ibutton_cli, cli);
|
||||||
|
furi_record_close(RECORD_CLI);
|
||||||
|
#else
|
||||||
|
UNUSED(ibutton_cli);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void ibutton_cli_print_usage(void) {
|
static void ibutton_cli_print_usage(void) {
|
||||||
printf("Usage:\r\n");
|
printf("Usage:\r\n");
|
||||||
printf("ikey read\r\n");
|
printf("ikey read\r\n");
|
||||||
@@ -18,7 +31,7 @@ static void ibutton_cli_print_usage(void) {
|
|||||||
printf("\tCyfral (2 bytes key_data)\r\n");
|
printf("\tCyfral (2 bytes key_data)\r\n");
|
||||||
printf("\tMetakom (4 bytes key_data), must contain correct parity\r\n");
|
printf("\tMetakom (4 bytes key_data), must contain correct parity\r\n");
|
||||||
printf("\t<key_data> are hex-formatted\r\n");
|
printf("\t<key_data> are hex-formatted\r\n");
|
||||||
}
|
};
|
||||||
|
|
||||||
static bool ibutton_cli_parse_key(iButtonProtocols* protocols, iButtonKey* key, FuriString* args) {
|
static bool ibutton_cli_parse_key(iButtonProtocols* protocols, iButtonKey* key, FuriString* args) {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@@ -111,7 +124,7 @@ static void ibutton_cli_read(Cli* cli) {
|
|||||||
ibutton_protocols_free(protocols);
|
ibutton_protocols_free(protocols);
|
||||||
|
|
||||||
furi_event_flag_free(event);
|
furi_event_flag_free(event);
|
||||||
}
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
FuriEventFlag* event;
|
FuriEventFlag* event;
|
||||||
@@ -203,7 +216,7 @@ void ibutton_cli_emulate(Cli* cli, FuriString* args) {
|
|||||||
|
|
||||||
while(!cli_cmd_interrupt_received(cli)) {
|
while(!cli_cmd_interrupt_received(cli)) {
|
||||||
furi_delay_ms(100);
|
furi_delay_ms(100);
|
||||||
}
|
};
|
||||||
|
|
||||||
} while(false);
|
} while(false);
|
||||||
|
|
||||||
@@ -213,7 +226,7 @@ void ibutton_cli_emulate(Cli* cli, FuriString* args) {
|
|||||||
ibutton_key_free(key);
|
ibutton_key_free(key);
|
||||||
ibutton_worker_free(worker);
|
ibutton_worker_free(worker);
|
||||||
ibutton_protocols_free(protocols);
|
ibutton_protocols_free(protocols);
|
||||||
}
|
};
|
||||||
|
|
||||||
void ibutton_cli(Cli* cli, FuriString* args, void* context) {
|
void ibutton_cli(Cli* cli, FuriString* args, void* context) {
|
||||||
UNUSED(cli);
|
UNUSED(cli);
|
||||||
@@ -239,16 +252,3 @@ void ibutton_cli(Cli* cli, FuriString* args, void* context) {
|
|||||||
|
|
||||||
furi_string_free(cmd);
|
furi_string_free(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <flipper_application/flipper_application.h>
|
|
||||||
#include <cli/cli_i.h>
|
|
||||||
|
|
||||||
static const FlipperAppPluginDescriptor plugin_descriptor = {
|
|
||||||
.appid = CLI_PLUGIN_APP_ID,
|
|
||||||
.ep_api_version = CLI_PLUGIN_API_VERSION,
|
|
||||||
.entry_point = &ibutton_cli,
|
|
||||||
};
|
|
||||||
|
|
||||||
const FlipperAppPluginDescriptor* ibutton_cli_plugin_ep(void) {
|
|
||||||
return &plugin_descriptor;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
#include <cli/cli_i.h>
|
|
||||||
|
|
||||||
static void ibutton_cli_wrapper(Cli* cli, FuriString* args, void* context) {
|
|
||||||
cli_plugin_wrapper("ibutton", cli, args, context);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ibutton_on_system_start(void) {
|
|
||||||
Cli* cli = furi_record_open(RECORD_CLI);
|
|
||||||
cli_add_command(cli, "ikey", CliCommandFlagDefault, ibutton_cli_wrapper, cli);
|
|
||||||
furi_record_close(RECORD_CLI);
|
|
||||||
}
|
|
||||||
@@ -15,23 +15,14 @@ App(
|
|||||||
)
|
)
|
||||||
|
|
||||||
App(
|
App(
|
||||||
appid="infrared_cli",
|
appid="infrared_start",
|
||||||
|
apptype=FlipperAppType.STARTUP,
|
||||||
targets=["f7"],
|
targets=["f7"],
|
||||||
apptype=FlipperAppType.PLUGIN,
|
entry_point="infrared_on_system_start",
|
||||||
entry_point="infrared_cli_plugin_ep",
|
|
||||||
requires=["cli"],
|
|
||||||
sources=[
|
sources=[
|
||||||
"infrared_cli.c",
|
"infrared_cli.c",
|
||||||
"infrared_brute_force.c",
|
"infrared_brute_force.c",
|
||||||
"infrared_signal.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,
|
order=20,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -553,16 +553,12 @@ static void infrared_cli_start_ir(Cli* cli, FuriString* args, void* context) {
|
|||||||
|
|
||||||
furi_string_free(command);
|
furi_string_free(command);
|
||||||
}
|
}
|
||||||
|
void infrared_on_system_start(void) {
|
||||||
#include <flipper_application/flipper_application.h>
|
#ifdef SRV_CLI
|
||||||
#include <cli/cli_i.h>
|
Cli* cli = (Cli*)furi_record_open(RECORD_CLI);
|
||||||
|
cli_add_command(cli, "ir", CliCommandFlagDefault, infrared_cli_start_ir, NULL);
|
||||||
static const FlipperAppPluginDescriptor plugin_descriptor = {
|
furi_record_close(RECORD_CLI);
|
||||||
.appid = CLI_PLUGIN_APP_ID,
|
#else
|
||||||
.ep_api_version = CLI_PLUGIN_API_VERSION,
|
UNUSED(infrared_cli_start_ir);
|
||||||
.entry_point = &infrared_cli_start_ir,
|
#endif
|
||||||
};
|
|
||||||
|
|
||||||
const FlipperAppPluginDescriptor* infrared_cli_plugin_ep(void) {
|
|
||||||
return &plugin_descriptor;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
#include <cli/cli_i.h>
|
|
||||||
|
|
||||||
static void infrared_cli_start_ir_wrapper(Cli* cli, FuriString* args, void* context) {
|
|
||||||
cli_plugin_wrapper("infrared", cli, args, context);
|
|
||||||
}
|
|
||||||
|
|
||||||
void infrared_on_system_start(void) {
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
@@ -12,20 +12,11 @@ App(
|
|||||||
fap_category="RFID",
|
fap_category="RFID",
|
||||||
)
|
)
|
||||||
|
|
||||||
App(
|
|
||||||
appid="lfrfid_cli",
|
|
||||||
targets=["f7"],
|
|
||||||
apptype=FlipperAppType.PLUGIN,
|
|
||||||
entry_point="lfrfid_cli_plugin_ep",
|
|
||||||
requires=["cli"],
|
|
||||||
sources=["lfrfid_cli.c"],
|
|
||||||
)
|
|
||||||
|
|
||||||
App(
|
App(
|
||||||
appid="lfrfid_start",
|
appid="lfrfid_start",
|
||||||
targets=["f7"],
|
targets=["f7"],
|
||||||
apptype=FlipperAppType.STARTUP,
|
apptype=FlipperAppType.STARTUP,
|
||||||
entry_point="lfrfid_on_system_start",
|
entry_point="lfrfid_on_system_start",
|
||||||
sources=["lfrfid_start.c"],
|
sources=["lfrfid_cli.c"],
|
||||||
order=50,
|
order=50,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -14,6 +14,15 @@
|
|||||||
#include <lfrfid/lfrfid_raw_file.h>
|
#include <lfrfid/lfrfid_raw_file.h>
|
||||||
#include <toolbox/pulse_protocols/pulse_glue.h>
|
#include <toolbox/pulse_protocols/pulse_glue.h>
|
||||||
|
|
||||||
|
static void lfrfid_cli(Cli* cli, FuriString* args, void* context);
|
||||||
|
|
||||||
|
// app cli function
|
||||||
|
void lfrfid_on_system_start(void) {
|
||||||
|
Cli* cli = furi_record_open(RECORD_CLI);
|
||||||
|
cli_add_command(cli, "rfid", CliCommandFlagDefault, lfrfid_cli, NULL);
|
||||||
|
furi_record_close(RECORD_CLI);
|
||||||
|
}
|
||||||
|
|
||||||
static void lfrfid_cli_print_usage(void) {
|
static void lfrfid_cli_print_usage(void) {
|
||||||
printf("Usage:\r\n");
|
printf("Usage:\r\n");
|
||||||
printf("rfid read <optional: normal | indala> - read in ASK/PSK mode\r\n");
|
printf("rfid read <optional: normal | indala> - read in ASK/PSK mode\r\n");
|
||||||
@@ -568,16 +577,3 @@ static void lfrfid_cli(Cli* cli, FuriString* args, void* context) {
|
|||||||
|
|
||||||
furi_string_free(cmd);
|
furi_string_free(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <flipper_application/flipper_application.h>
|
|
||||||
#include <cli/cli_i.h>
|
|
||||||
|
|
||||||
static const FlipperAppPluginDescriptor plugin_descriptor = {
|
|
||||||
.appid = CLI_PLUGIN_APP_ID,
|
|
||||||
.ep_api_version = CLI_PLUGIN_API_VERSION,
|
|
||||||
.entry_point = &lfrfid_cli,
|
|
||||||
};
|
|
||||||
|
|
||||||
const FlipperAppPluginDescriptor* lfrfid_cli_plugin_ep(void) {
|
|
||||||
return &plugin_descriptor;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
#include <cli/cli_i.h>
|
|
||||||
|
|
||||||
static void lfrfid_cli_wrapper(Cli* cli, FuriString* args, void* context) {
|
|
||||||
cli_plugin_wrapper("lfrfid", cli, args, context);
|
|
||||||
}
|
|
||||||
|
|
||||||
void lfrfid_on_system_start(void) {
|
|
||||||
Cli* cli = furi_record_open(RECORD_CLI);
|
|
||||||
cli_add_command(cli, "rfid", CliCommandFlagDefault, lfrfid_cli_wrapper, NULL);
|
|
||||||
furi_record_close(RECORD_CLI);
|
|
||||||
}
|
|
||||||
@@ -310,15 +310,6 @@ App(
|
|||||||
sources=["plugins/supported_cards/trt.c"],
|
sources=["plugins/supported_cards/trt.c"],
|
||||||
)
|
)
|
||||||
|
|
||||||
App(
|
|
||||||
appid="nfc_cli",
|
|
||||||
targets=["f7"],
|
|
||||||
apptype=FlipperAppType.PLUGIN,
|
|
||||||
entry_point="nfc_cli_plugin_ep",
|
|
||||||
requires=["cli"],
|
|
||||||
sources=["nfc_cli.c"],
|
|
||||||
)
|
|
||||||
|
|
||||||
App(
|
App(
|
||||||
appid="disney_infinity_parser",
|
appid="disney_infinity_parser",
|
||||||
apptype=FlipperAppType.PLUGIN,
|
apptype=FlipperAppType.PLUGIN,
|
||||||
@@ -334,6 +325,6 @@ App(
|
|||||||
targets=["f7"],
|
targets=["f7"],
|
||||||
apptype=FlipperAppType.STARTUP,
|
apptype=FlipperAppType.STARTUP,
|
||||||
entry_point="nfc_on_system_start",
|
entry_point="nfc_on_system_start",
|
||||||
sources=["nfc_start.c"],
|
sources=["nfc_cli.c"],
|
||||||
order=30,
|
order=30,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -226,15 +226,12 @@ static void nfc_cli(Cli* cli, FuriString* args, void* context) {
|
|||||||
furi_string_free(cmd);
|
furi_string_free(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <flipper_application/flipper_application.h>
|
void nfc_on_system_start(void) {
|
||||||
#include <cli/cli_i.h>
|
#ifdef SRV_CLI
|
||||||
|
Cli* cli = furi_record_open(RECORD_CLI);
|
||||||
static const FlipperAppPluginDescriptor plugin_descriptor = {
|
cli_add_command(cli, "nfc", CliCommandFlagDefault, nfc_cli, NULL);
|
||||||
.appid = CLI_PLUGIN_APP_ID,
|
furi_record_close(RECORD_CLI);
|
||||||
.ep_api_version = CLI_PLUGIN_API_VERSION,
|
#else
|
||||||
.entry_point = &nfc_cli,
|
UNUSED(nfc_cli);
|
||||||
};
|
#endif
|
||||||
|
|
||||||
const FlipperAppPluginDescriptor* nfc_cli_plugin_ep(void) {
|
|
||||||
return &plugin_descriptor;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
#include <cli/cli_i.h>
|
|
||||||
|
|
||||||
static void nfc_cli_wrapper(Cli* cli, FuriString* args, void* context) {
|
|
||||||
cli_plugin_wrapper("nfc", cli, args, context);
|
|
||||||
}
|
|
||||||
|
|
||||||
void nfc_on_system_start(void) {
|
|
||||||
Cli* cli = furi_record_open(RECORD_CLI);
|
|
||||||
cli_add_command(cli, "nfc", CliCommandFlagDefault, nfc_cli_wrapper, NULL);
|
|
||||||
furi_record_close(RECORD_CLI);
|
|
||||||
}
|
|
||||||
@@ -1,16 +1,6 @@
|
|||||||
App(
|
|
||||||
appid="onewire_cli",
|
|
||||||
targets=["f7"],
|
|
||||||
apptype=FlipperAppType.PLUGIN,
|
|
||||||
entry_point="onewire_cli_plugin_ep",
|
|
||||||
requires=["cli"],
|
|
||||||
sources=["onewire_cli.c"],
|
|
||||||
)
|
|
||||||
|
|
||||||
App(
|
App(
|
||||||
appid="onewire_start",
|
appid="onewire_start",
|
||||||
apptype=FlipperAppType.STARTUP,
|
apptype=FlipperAppType.STARTUP,
|
||||||
entry_point="onewire_on_system_start",
|
entry_point="onewire_on_system_start",
|
||||||
sources=["onewire_start.c"],
|
|
||||||
order=60,
|
order=60,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,10 +8,22 @@
|
|||||||
|
|
||||||
#include <one_wire/one_wire_host.h>
|
#include <one_wire/one_wire_host.h>
|
||||||
|
|
||||||
|
static void onewire_cli(Cli* cli, FuriString* args, void* context);
|
||||||
|
|
||||||
|
void onewire_on_system_start(void) {
|
||||||
|
#ifdef SRV_CLI
|
||||||
|
Cli* cli = furi_record_open(RECORD_CLI);
|
||||||
|
cli_add_command(cli, "onewire", CliCommandFlagDefault, onewire_cli, cli);
|
||||||
|
furi_record_close(RECORD_CLI);
|
||||||
|
#else
|
||||||
|
UNUSED(onewire_cli);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void onewire_cli_print_usage(void) {
|
static void onewire_cli_print_usage(void) {
|
||||||
printf("Usage:\r\n");
|
printf("Usage:\r\n");
|
||||||
printf("onewire search\r\n");
|
printf("onewire search\r\n");
|
||||||
}
|
};
|
||||||
|
|
||||||
static void onewire_cli_search(Cli* cli) {
|
static void onewire_cli_search(Cli* cli) {
|
||||||
UNUSED(cli);
|
UNUSED(cli);
|
||||||
@@ -63,16 +75,3 @@ void onewire_cli(Cli* cli, FuriString* args, void* context) {
|
|||||||
|
|
||||||
furi_string_free(cmd);
|
furi_string_free(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <flipper_application/flipper_application.h>
|
|
||||||
#include <cli/cli_i.h>
|
|
||||||
|
|
||||||
static const FlipperAppPluginDescriptor plugin_descriptor = {
|
|
||||||
.appid = CLI_PLUGIN_APP_ID,
|
|
||||||
.ep_api_version = CLI_PLUGIN_API_VERSION,
|
|
||||||
.entry_point = &onewire_cli,
|
|
||||||
};
|
|
||||||
|
|
||||||
const FlipperAppPluginDescriptor* onewire_cli_plugin_ep(void) {
|
|
||||||
return &plugin_descriptor;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
#include <cli/cli_i.h>
|
|
||||||
|
|
||||||
static void onewire_cli_wrapper(Cli* cli, FuriString* args, void* context) {
|
|
||||||
cli_plugin_wrapper("onewire", cli, args, context);
|
|
||||||
}
|
|
||||||
|
|
||||||
void onewire_on_system_start(void) {
|
|
||||||
Cli* cli = furi_record_open(RECORD_CLI);
|
|
||||||
cli_add_command(cli, "onewire", CliCommandFlagDefault, onewire_cli_wrapper, cli);
|
|
||||||
furi_record_close(RECORD_CLI);
|
|
||||||
}
|
|
||||||
@@ -4,10 +4,6 @@
|
|||||||
#include <furi_hal_version.h>
|
#include <furi_hal_version.h>
|
||||||
#include <loader/loader.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 TAG "CliSrv"
|
||||||
|
|
||||||
#define CLI_INPUT_LEN_LIMIT 256
|
#define CLI_INPUT_LEN_LIMIT 256
|
||||||
@@ -486,19 +482,3 @@ int32_t cli_srv(void* p) {
|
|||||||
|
|
||||||
return 0;
|
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);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -63,13 +63,6 @@ void cli_putc(Cli* cli, char c);
|
|||||||
|
|
||||||
void cli_stdout_callback(void* _cookie, const char* data, size_t size);
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user