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

Go to the source code of this file.

Functions

static int add_debug_msg_receiver (struct command_context *cmd_ctx, struct target *target)
 
 COMMAND_HANDLER (handle_target_request_debugmsgs_command)
 
int delete_debug_msg_receiver (struct command_context *cmd_ctx, struct target *target)
 
static struct debug_msg_receiverfind_debug_msg_receiver (struct command_context *cmd_ctx, struct target *target)
 
static int target_asciimsg (struct target *target, uint32_t length)
 
static int target_charmsg (struct target *target, uint8_t msg)
 
bool target_got_message (void)
 Read and clear the flag as to whether we got a message. More...
 
static int target_hexmsg (struct target *target, int size, uint32_t length)
 
int target_request (struct target *target, uint32_t request)
 
int target_request_register_commands (struct command_context *cmd_ctx)
 

Variables

static int charmsg_mode
 
static bool got_message
 
static const struct command_registration target_req_command_handlers []
 
static const struct command_registration target_req_exec_command_handlers []
 

Function Documentation

◆ add_debug_msg_receiver()

static int add_debug_msg_receiver ( struct command_context cmd_ctx,
struct target target 
)
static

◆ COMMAND_HANDLER()

◆ delete_debug_msg_receiver()

int delete_debug_msg_receiver ( struct command_context cmd_ctx,
struct target target 
)

◆ find_debug_msg_receiver()

static struct debug_msg_receiver* find_debug_msg_receiver ( struct command_context cmd_ctx,
struct target target 
)
static

Definition at line 172 of file target_request.c.

References all_targets, debug_msg_receiver::cmd_ctx, target::dbgmsg, target::next, and NULL.

Referenced by COMMAND_HANDLER().

◆ target_asciimsg()

static int target_asciimsg ( struct target target,
uint32_t  length 
)
static

◆ target_charmsg()

static int target_charmsg ( struct target target,
uint8_t  msg 
)
static

Definition at line 55 of file target_request.c.

References ERROR_OK, and LOG_USER_N.

Referenced by target_request().

◆ target_got_message()

bool target_got_message ( void  )

Read and clear the flag as to whether we got a message.

This is used to implement the back-off algorithm on sleeping in idle mode.

Definition at line 28 of file target_request.c.

References got_message.

Referenced by server_loop().

◆ target_hexmsg()

static int target_hexmsg ( struct target target,
int  size,
uint32_t  length 
)
static

◆ target_request()

◆ target_request_register_commands()

int target_request_register_commands ( struct command_context cmd_ctx)

Definition at line 301 of file target_request.c.

References NULL, register_commands(), and target_req_command_handlers.

Referenced by target_register_user_commands().

Variable Documentation

◆ charmsg_mode

int charmsg_mode
static

Definition at line 35 of file target_request.c.

Referenced by COMMAND_HANDLER(), and target_request().

◆ got_message

bool got_message
static

Definition at line 26 of file target_request.c.

Referenced by target_got_message(), and target_request().

◆ target_req_command_handlers

const struct command_registration target_req_command_handlers[]
static
Initial value:
= {
{
.name = "target_request",
.mode = COMMAND_ANY,
.help = "target request command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_ANY
Definition: command.h:42
static const struct command_registration target_req_exec_command_handlers[]

Definition at line 242 of file target_request.c.

Referenced by target_request_register_commands().

◆ target_req_exec_command_handlers

const struct command_registration target_req_exec_command_handlers[]
static
Initial value:
= {
{
.name = "debugmsgs",
.handler = handle_target_request_debugmsgs_command,
.mode = COMMAND_EXEC,
.help = "display and/or modify reception of debug messages from target",
.usage = "['enable'|'charmsg'|'disable']",
},
}
@ COMMAND_EXEC
Definition: command.h:40

Definition at line 242 of file target_request.c.