Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shell_telnet.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_SHELL_TELNET_H_
14#define ZEPHYR_INCLUDE_SHELL_TELNET_H_
15
16#include <zephyr/net/socket.h>
17#include <zephyr/shell/shell.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
24
25#define SHELL_TELNET_POLLFD_COUNT 3
26#define SHELL_TELNET_MAX_CMD_SIZE 3
27
31 char buf[CONFIG_SHELL_TELNET_LINE_BUF_SIZE];
32
35};
36
72
73#define SHELL_TELNET_DEFINE(_name) \
74 static struct shell_telnet _name##_shell_telnet; \
75 struct shell_transport _name = { \
76 .api = &shell_telnet_transport_api, \
77 .ctx = (struct shell_telnet *)&_name##_shell_telnet \
78 }
79
89
90#ifdef __cplusplus
91}
92#endif
93
94#endif /* ZEPHYR_INCLUDE_SHELL_TELNET_H_ */
void(* shell_transport_handler_t)(enum shell_transport_evt evt, void *context)
Definition shell.h:795
BSD Sockets compatible API definitions.
#define CONFIG_SHELL_CMD_BUFF_SIZE
Definition shell.h:35
const struct shell_transport_api shell_telnet_transport_api
const struct shell * shell_backend_telnet_get_ptr(void)
This function provides pointer to shell telnet backend instance.
#define SHELL_TELNET_POLLFD_COUNT
Definition shell_telnet.h:25
#define SHELL_TELNET_MAX_CMD_SIZE
Definition shell_telnet.h:26
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Kernel mutex structure.
Definition kernel.h:3437
A structure used to submit work after a delay.
Definition kernel.h:4603
A structure holding internal state for a pending synchronous operation on a work item or queue.
Definition kernel.h:4698
Line buffer structure.
Definition shell_telnet.h:29
uint16_t len
Current line length.
Definition shell_telnet.h:34
char buf[CONFIG_SHELL_TELNET_LINE_BUF_SIZE]
Line buffer.
Definition shell_telnet.h:31
TELNET-based shell transport.
Definition shell_telnet.h:38
struct k_work_delayable send_work
The delayed work is used to send non-lf terminated output that has been around for "too long".
Definition shell_telnet.h:66
shell_transport_handler_t shell_handler
Handler function registered by shell.
Definition shell_telnet.h:40
uint8_t cmd_len
Definition shell_telnet.h:60
uint8_t rx_buf[0]
Input buffer.
Definition shell_telnet.h:52
uint8_t cmd_buf[3]
Definition shell_telnet.h:59
void * shell_context
Context registered by shell.
Definition shell_telnet.h:43
struct k_mutex rx_lock
Mutex protecting the input buffer access.
Definition shell_telnet.h:58
struct shell_telnet_line_buf line_out
Buffer for outgoing line.
Definition shell_telnet.h:46
bool output_lock
If set, no output is sent to the TELNET client.
Definition shell_telnet.h:70
struct zsock_pollfd fds[3]
Array for sockets used by the telnet service.
Definition shell_telnet.h:49
struct k_work_sync work_sync
Definition shell_telnet.h:67
size_t rx_len
Number of data bytes within the input buffer.
Definition shell_telnet.h:55
Unified shell transport interface.
Definition shell.h:818
Shell instance internals.
Definition shell.h:1063
Definition of the monitored socket/file descriptor.
Definition socket_poll.h:31