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

Go to the source code of this file.

Data Structures

struct  tcl_connection
 

Macros

#define ESTR   "line too long\n"
 
#define TCL_LINE_INITIAL   (4*1024)
 
#define TCL_LINE_MAX   (4*1024*1024)
 
#define TCL_SERVER_VERSION   "TCL Server 0.1"
 

Functions

 COMMAND_HANDLER (handle_tcl_notifications_command)
 
 COMMAND_HANDLER (handle_tcl_port_command)
 
 COMMAND_HANDLER (handle_tcl_trace_command)
 
static int tcl_closed (struct connection *connection)
 
int tcl_init (void)
 
static int tcl_input (struct connection *connection)
 
static int tcl_new_connection (struct connection *connection)
 
static int tcl_output (struct connection *connection, const void *buf, ssize_t len)
 
int tcl_register_commands (struct command_context *cmd_ctx)
 
void tcl_service_free (void)
 
static int tcl_target_callback_event_handler (struct target *target, enum target_event event, void *priv)
 
static int tcl_target_callback_reset_handler (struct target *target, enum target_reset_mode reset_mode, void *priv)
 
static int tcl_target_callback_trace_handler (struct target *target, size_t len, uint8_t *data, void *priv)
 

Variables

static const struct command_registration tcl_command_handlers []
 
static char * tcl_port
 
static const struct service_driver tcl_service_driver
 

Macro Definition Documentation

◆ ESTR

#define ESTR   "line too long\n"

◆ TCL_LINE_INITIAL

#define TCL_LINE_INITIAL   (4*1024)

Definition at line 17 of file tcl_server.c.

◆ TCL_LINE_MAX

#define TCL_LINE_MAX   (4*1024*1024)

Definition at line 18 of file tcl_server.c.

◆ TCL_SERVER_VERSION

#define TCL_SERVER_VERSION   "TCL Server 0.1"

Definition at line 16 of file tcl_server.c.

Function Documentation

◆ COMMAND_HANDLER() [1/3]

COMMAND_HANDLER ( handle_tcl_notifications_command  )

◆ COMMAND_HANDLER() [2/3]

COMMAND_HANDLER ( handle_tcl_port_command  )

Definition at line 287 of file tcl_server.c.

References CALL_COMMAND_HANDLER, and tcl_port.

◆ COMMAND_HANDLER() [3/3]

COMMAND_HANDLER ( handle_tcl_trace_command  )

◆ tcl_closed()

◆ tcl_init()

int tcl_init ( void  )

Definition at line 277 of file tcl_server.c.

References add_service(), CONNECTION_LIMIT_UNLIMITED, ERROR_OK, LOG_INFO, NULL, tcl_port, and tcl_service_driver.

Referenced by server_init().

◆ tcl_input()

◆ tcl_new_connection()

◆ tcl_output()

int tcl_output ( struct connection connection,
const void *  buf,
ssize_t  len 
)
static

◆ tcl_register_commands()

int tcl_register_commands ( struct command_context cmd_ctx)

Definition at line 353 of file tcl_server.c.

References NULL, register_commands(), tcl_command_handlers, and tcl_port.

Referenced by server_register_commands().

◆ tcl_service_free()

void tcl_service_free ( void  )

Definition at line 359 of file tcl_server.c.

References tcl_port.

Referenced by server_free().

◆ tcl_target_callback_event_handler()

static int tcl_target_callback_event_handler ( struct target target,
enum target_event  event,
void *  priv 
)
static

◆ tcl_target_callback_reset_handler()

static int tcl_target_callback_reset_handler ( struct target target,
enum target_reset_mode  reset_mode,
void *  priv 
)
static

◆ tcl_target_callback_trace_handler()

static int tcl_target_callback_trace_handler ( struct target target,
size_t  len,
uint8_t *  data,
void *  priv 
)
static

Definition at line 81 of file tcl_server.c.

References ERROR_OK, hexify(), priv, connection::priv, tcl_connection::tc_trace, and tcl_output().

Referenced by tcl_closed(), and tcl_new_connection().

Variable Documentation

◆ tcl_command_handlers

const struct command_registration tcl_command_handlers[]
static
Initial value:
= {
{
.name = "tcl_port",
.handler = handle_tcl_port_command,
.mode = COMMAND_CONFIG,
.help = "Specify port on which to listen "
"for incoming Tcl syntax. "
"Read help on 'gdb_port'.",
.usage = "[port_num]",
},
{
.name = "tcl_notifications",
.handler = handle_tcl_notifications_command,
.mode = COMMAND_EXEC,
.help = "Target Notification output",
.usage = "[on|off]",
},
{
.name = "tcl_trace",
.handler = handle_tcl_trace_command,
.mode = COMMAND_EXEC,
.help = "Target trace output",
.usage = "[on|off]",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_CONFIG
Definition: command.h:41
@ COMMAND_EXEC
Definition: command.h:40

Definition at line 309 of file tcl_server.c.

Referenced by tcl_register_commands().

◆ tcl_port

char* tcl_port
static

Definition at line 31 of file tcl_server.c.

Referenced by COMMAND_HANDLER(), tcl_init(), tcl_register_commands(), and tcl_service_free().

◆ tcl_service_driver

const struct service_driver tcl_service_driver
static
Initial value:
= {
.name = "tcl",
.new_connection_during_keep_alive_handler = NULL,
.new_connection_handler = tcl_new_connection,
.input_handler = tcl_input,
.connection_closed_handler = tcl_closed,
.keep_client_alive_handler = NULL,
}
static int tcl_new_connection(struct connection *connection)
Definition: tcl_server.c:132
static int tcl_closed(struct connection *connection)
Definition: tcl_server.c:249
static int tcl_input(struct connection *connection)
Definition: tcl_server.c:163
#define NULL
Definition: usb.h:16

Definition at line 249 of file tcl_server.c.

Referenced by tcl_init().