All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cli_registry.h File Reference

API for registering commands with a CLI shell. More...

#include <furi.h>
#include <m-array.h>
#include <toolbox/pipe.h>
#include "cli_command.h"

Go to the source code of this file.

Typedefs

typedef struct CliRegistry CliRegistry
 

Functions

CliRegistrycli_registry_alloc (void)
 Allocates a CliRegistry.
 
void cli_registry_free (CliRegistry *registry)
 Frees a CliRegistry.
 
void cli_registry_add_command (CliRegistry *registry, const char *name, CliCommandFlag flags, CliCommandExecuteCallback callback, void *context)
 Registers a command with the registry.
 
void cli_registry_add_command_ex (CliRegistry *registry, const char *name, CliCommandFlag flags, CliCommandExecuteCallback callback, void *context, size_t stack_size)
 Registers a command with the registry.
 
void cli_registry_delete_command (CliRegistry *registry, const char *name)
 Deletes a cli command.
 
void cli_registry_remove_external_commands (CliRegistry *registry)
 Unregisters all external commands.
 
void cli_registry_reload_external_commands (CliRegistry *registry, const CliCommandExternalConfig *config)
 Reloads the list of externally available commands.
 

Detailed Description

API for registering commands with a CLI shell.

Function Documentation

◆ cli_registry_add_command()

void cli_registry_add_command ( CliRegistry * registry,
const char * name,
CliCommandFlag flags,
CliCommandExecuteCallback callback,
void * context )

Registers a command with the registry.

Provides less options than the _ex counterpart.

Parameters
[in]registryPointer to registry instance
[in]nameCommand name
[in]flagssee CliCommandFlag
[in]callbackCallback function
[in]contextCustom context

◆ cli_registry_add_command_ex()

void cli_registry_add_command_ex ( CliRegistry * registry,
const char * name,
CliCommandFlag flags,
CliCommandExecuteCallback callback,
void * context,
size_t stack_size )

Registers a command with the registry.

Provides more options than the non-_ex counterpart.

Parameters
[in]registryPointer to registry instance
[in]nameCommand name
[in]flagssee CliCommandFlag
[in]callbackCallback function
[in]contextCustom context
[in]stack_sizeThread stack size

◆ cli_registry_delete_command()

void cli_registry_delete_command ( CliRegistry * registry,
const char * name )

Deletes a cli command.

Parameters
[in]registryPointer to registry instance
[in]nameCommand name

◆ cli_registry_reload_external_commands()

void cli_registry_reload_external_commands ( CliRegistry * registry,
const CliCommandExternalConfig * config )

Reloads the list of externally available commands.

Parameters
[in]registryPointer to registry instance
[in]configSee CliCommandExternalConfig

◆ cli_registry_remove_external_commands()

void cli_registry_remove_external_commands ( CliRegistry * registry)

Unregisters all external commands.

Parameters
[in]registryPointer to registry instance