All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cli_registry_i.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <furi.h>
9#include <m-bptree.h>
10#include "cli_registry.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#define CLI_BUILTIN_COMMAND_STACK_SIZE (4 * 1024U)
17
18typedef struct {
19 void* context; //<! Context passed to callbacks
20 CliCommandExecuteCallback execute_callback; //<! Callback for command execution
21 CliCommandFlag flags;
22 size_t stack_depth;
24
25#define CLI_COMMANDS_TREE_RANK 4
26
27// -V:BPTREE_DEF2:1103
28// -V:BPTREE_DEF2:524
29BPTREE_DEF2(
30 CliCommandTree,
31 CLI_COMMANDS_TREE_RANK,
35 M_POD_OPLIST);
36
37#define M_OPL_CliCommandTree_t() BPTREE_OPLIST2(CliCommandTree, FURI_STRING_OPLIST, M_POD_OPLIST)
38
39bool cli_registry_get_command(
40 CliRegistry* registry,
41 FuriString* command,
42 CliRegistryCommand* result);
43
44void cli_registry_lock(CliRegistry* registry);
45
46void cli_registry_unlock(CliRegistry* registry);
47
51CliCommandTree_t* cli_registry_get_commands(CliRegistry* registry);
52
53#ifdef __cplusplus
54}
55#endif
CliCommandFlag
Definition cli_command.h:18
void(* CliCommandExecuteCallback)(PipeSide *pipe, FuriString *args, void *context)
CLI command execution callback pointer.
Definition cli_command.h:47
API for registering commands with a CLI shell.
CliCommandTree_t * cli_registry_get_commands(CliRegistry *registry)
Definition cli_registry.c:175
#define FURI_STRING_OPLIST
OPLIST for FuriString.
Definition string.h:778
Definition cli_registry_i.h:18
Definition cli_registry.c:8
Definition string.c:4