OpenOCD
hello.c File Reference
Include dependency graph for hello.c:

Go to the source code of this file.

Functions

 COMMAND_HANDLER (handle_flag_command)
 
 COMMAND_HANDLER (handle_foo_command)
 
 COMMAND_HANDLER (handle_hello_command)
 
static COMMAND_HELPER (handle_hello_args, const char **sep, const char **name)
 

Variables

static const struct command_registration foo_command_handlers []
 
static bool foo_flag
 
const struct command_registration hello_command_handlers []
 Export the registration for the hello command group, so it can be embedded in example drivers. More...
 

Function Documentation

◆ COMMAND_HANDLER() [1/3]

COMMAND_HANDLER ( handle_flag_command  )

Definition at line 34 of file hello.c.

References CALL_COMMAND_HANDLER, and foo_flag.

◆ COMMAND_HANDLER() [2/3]

COMMAND_HANDLER ( handle_foo_command  )

◆ COMMAND_HANDLER() [3/3]

COMMAND_HANDLER ( handle_hello_command  )

Definition at line 77 of file hello.c.

References CALL_COMMAND_HANDLER, CMD, command_print(), ERROR_OK, and name.

◆ COMMAND_HELPER()

static COMMAND_HELPER ( handle_hello_args  ,
const char **  sep,
const char **  name 
)
static

Definition at line 65 of file hello.c.

References CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and name.

Variable Documentation

◆ foo_command_handlers

const struct command_registration foo_command_handlers[]
static
Initial value:
= {
{
.name = "bar",
.handler = &handle_foo_command,
.mode = COMMAND_ANY,
.usage = "address ['enable'|'disable']",
.help = "an example command",
},
{
.name = "baz",
.handler = &handle_foo_command,
.mode = COMMAND_ANY,
.usage = "address ['enable'|'disable']",
.help = "a sample command",
},
{
.name = "flag",
.handler = &handle_flag_command,
.mode = COMMAND_ANY,
.usage = "[on|off]",
.help = "set a flag",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:253
@ COMMAND_ANY
Definition: command.h:42

Definition at line 34 of file hello.c.

◆ foo_flag

bool foo_flag
static

Definition at line 32 of file hello.c.

Referenced by COMMAND_HANDLER().

◆ hello_command_handlers

const struct command_registration hello_command_handlers[]
Initial value:
= {
{
.name = "hello",
.handler = handle_hello_command,
.mode = COMMAND_ANY,
.help = "prints a warm welcome",
.usage = "[name]",
},
{
.name = "foo",
.mode = COMMAND_ANY,
.help = "example command handler skeleton",
.usage = "",
},
}
static const struct command_registration foo_command_handlers[]
Definition: hello.c:40
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:241

Export the registration for the hello command group, so it can be embedded in example drivers.

Definition at line 77 of file hello.c.