Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shell_websocket.h File Reference

Go to the source code of this file.

Data Structures

struct  shell_websocket_line_buf
 Line buffer structure. More...
 
struct  shell_websocket
 WEBSOCKET-based shell transport. More...
 

Macros

#define SHELL_WEBSOCKET_SERVICE_COUNT   CONFIG_SHELL_WEBSOCKET_BACKEND_COUNT
 
#define GET_WS_NAME(_service)
 
#define GET_WS_SHELL_NAME(_name)
 
#define GET_WS_TRANSPORT_NAME(_service)
 
#define GET_WS_DETAIL_NAME(_service)
 
#define SHELL_WEBSOCKET_DEFINE(_service)
 
#define SHELL_WS_PORT_NAME(_service)
 
#define SHELL_WS_BUF_NAME(_service)
 
#define SHELL_WS_TEMP_RECV_BUF_SIZE   256
 
#define DEFINE_WEBSOCKET_HTTP_SERVICE(_service)
 
#define DEFINE_WEBSOCKET_SERVICE(_service)
 
#define WEBSOCKET_CONSOLE_DEFINE(_service, _sec_tag_list, _sec_tag_list_size)
 
#define WEBSOCKET_CONSOLE_ENABLE(_service)
 

Functions

int shell_websocket_setup (int ws_socket, void *user_data)
 
int shell_websocket_enable (const struct shell *sh)
 

Variables

const struct shell_transport_api shell_websocket_transport_api
 

Macro Definition Documentation

◆ DEFINE_WEBSOCKET_HTTP_SERVICE

#define DEFINE_WEBSOCKET_HTTP_SERVICE ( _service)
Value:
GET_WS_DETAIL_NAME(_service) = { \
.common = { \
\
/* We need HTTP/1.1 GET method for upgrading */ \
.bitmask_of_supported_http_methods = BIT(HTTP_GET), \
}, \
.data_buffer = SHELL_WS_BUF_NAME(_service), \
.data_buffer_len = sizeof(SHELL_WS_BUF_NAME(_service)), \
.user_data = &GET_WS_NAME(_service), \
}; \
HTTP_RESOURCE_DEFINE(ws_resource_##_service, _service, \
"/" CONFIG_SHELL_WEBSOCKET_ENDPOINT_URL, \
&GET_WS_DETAIL_NAME(_service))
@ HTTP_GET
GET.
Definition method.h:30
@ HTTP_RESOURCE_TYPE_WEBSOCKET
Websocket resource, application takes control over Websocket connection after and upgrade.
Definition server.h:74
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
#define GET_WS_NAME(_service)
Definition shell_websocket.h:68
#define SHELL_WS_TEMP_RECV_BUF_SIZE
Definition shell_websocket.h:82
#define SHELL_WS_BUF_NAME(_service)
Definition shell_websocket.h:81
int shell_websocket_setup(int ws_socket, void *user_data)
#define GET_WS_DETAIL_NAME(_service)
Definition shell_websocket.h:71
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Representation of a websocket server resource.
Definition server.h:248
void * user_data
A pointer to the user data registered by the application.
Definition server.h:269

◆ DEFINE_WEBSOCKET_SERVICE

#define DEFINE_WEBSOCKET_SERVICE ( _service)
Value:
SHELL_DEFINE(shell_websocket_##_service, \
CONFIG_SHELL_WEBSOCKET_PROMPT, \
&GET_WS_TRANSPORT_NAME(_service), \
CONFIG_SHELL_WEBSOCKET_LOG_MESSAGE_QUEUE_SIZE, \
CONFIG_SHELL_WEBSOCKET_LOG_MESSAGE_QUEUE_TIMEOUT, \
DEFINE_WEBSOCKET_HTTP_SERVICE(_service)
@ SHELL_FLAG_OLF_CRLF
Map LF to CRLF on output.
Definition shell.h:884
#define SHELL_WEBSOCKET_DEFINE(_service)
Definition shell_websocket.h:73
#define GET_WS_TRANSPORT_NAME(_service)
Definition shell_websocket.h:70

◆ GET_WS_DETAIL_NAME

#define GET_WS_DETAIL_NAME ( _service)
Value:
ws_res_detail_##_service

◆ GET_WS_NAME

#define GET_WS_NAME ( _service)
Value:
ws_ctx_##_service

◆ GET_WS_SHELL_NAME

#define GET_WS_SHELL_NAME ( _name)
Value:
shell_websocket_##_name

◆ GET_WS_TRANSPORT_NAME

#define GET_WS_TRANSPORT_NAME ( _service)
Value:
transport_shell_ws_##_service

◆ SHELL_WEBSOCKET_DEFINE

#define SHELL_WEBSOCKET_DEFINE ( _service)
Value:
static struct shell_websocket GET_WS_NAME(_service); \
static struct shell_transport GET_WS_TRANSPORT_NAME(_service) = { \
.ctx = &GET_WS_NAME(_service), \
}
const struct shell_transport_api shell_websocket_transport_api
Definition shell.h:724
WEBSOCKET-based shell transport.
Definition shell_websocket.h:31

◆ SHELL_WEBSOCKET_SERVICE_COUNT

#define SHELL_WEBSOCKET_SERVICE_COUNT   CONFIG_SHELL_WEBSOCKET_BACKEND_COUNT

◆ SHELL_WS_BUF_NAME

#define SHELL_WS_BUF_NAME ( _service)
Value:
ws_recv_buffer_##_service

◆ SHELL_WS_PORT_NAME

#define SHELL_WS_PORT_NAME ( _service)
Value:
http_service_##_service

◆ SHELL_WS_TEMP_RECV_BUF_SIZE

#define SHELL_WS_TEMP_RECV_BUF_SIZE   256

◆ WEBSOCKET_CONSOLE_DEFINE

#define WEBSOCKET_CONSOLE_DEFINE ( _service,
_sec_tag_list,
_sec_tag_list_size )
Value:
static uint16_t SHELL_WS_PORT_NAME(_service) = \
CONFIG_SHELL_WEBSOCKET_PORT; \
HTTP_SERVICE_DEFINE(_service, \
CONFIG_SHELL_WEBSOCKET_IP_ADDR, \
&SHELL_WS_PORT_NAME(_service), \
NULL); \
DEFINE_WEBSOCKET_SERVICE(_service)
#define SHELL_WS_PORT_NAME(_service)
Definition shell_websocket.h:80
#define SHELL_WEBSOCKET_SERVICE_COUNT
Definition shell_websocket.h:19
__UINT16_TYPE__ uint16_t
Definition stdint.h:89

◆ WEBSOCKET_CONSOLE_ENABLE

#define WEBSOCKET_CONSOLE_ENABLE ( _service)
Value:
#define GET_WS_SHELL_NAME(_name)
Definition shell_websocket.h:69
int shell_websocket_enable(const struct shell *sh)

Function Documentation

◆ shell_websocket_enable()

int shell_websocket_enable ( const struct shell * sh)
extern

◆ shell_websocket_setup()

int shell_websocket_setup ( int ws_socket,
void * user_data )
extern

Variable Documentation

◆ shell_websocket_transport_api

const struct shell_transport_api shell_websocket_transport_api
extern