Zephyr Project API 3.7.0
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
7#ifndef SHELL_TELNET_H__
8#define SHELL_TELNET_H__
9
10#include <zephyr/net/socket.h>
11#include <zephyr/shell/shell.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
18
19#define SHELL_TELNET_POLLFD_COUNT 3
20#define SHELL_TELNET_MAX_CMD_SIZE 3
21
25 char buf[CONFIG_SHELL_TELNET_LINE_BUF_SIZE];
26
29};
30
66
67#define SHELL_TELNET_DEFINE(_name) \
68 static struct shell_telnet _name##_shell_telnet; \
69 struct shell_transport _name = { \
70 .api = &shell_telnet_transport_api, \
71 .ctx = (struct shell_telnet *)&_name##_shell_telnet \
72 }
73
83
84#ifdef __cplusplus
85}
86#endif
87
88#endif /* SHELL_TELNET_H__ */
void(* shell_transport_handler_t)(enum shell_transport_evt evt, void *context)
Definition shell.h:624
BSD Sockets compatible API definitions.
#define CONFIG_SHELL_CMD_BUFF_SIZE
Definition shell.h:34
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:19
#define SHELL_TELNET_MAX_CMD_SIZE
Definition shell_telnet.h:20
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Mutex Structure.
Definition kernel.h:2917
A structure used to submit work after a delay.
Definition kernel.h:3908
A structure holding internal state for a pending synchronous operation on a work item or queue.
Definition kernel.h:3991
Line buffer structure.
Definition shell_telnet.h:23
uint16_t len
Current line length.
Definition shell_telnet.h:28
char buf[CONFIG_SHELL_TELNET_LINE_BUF_SIZE]
Line buffer.
Definition shell_telnet.h:25
TELNET-based shell transport.
Definition shell_telnet.h:32
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:60
shell_transport_handler_t shell_handler
Handler function registered by shell.
Definition shell_telnet.h:34
uint8_t cmd_len
Definition shell_telnet.h:54
uint8_t cmd_buf[3]
Definition shell_telnet.h:53
void * shell_context
Context registered by shell.
Definition shell_telnet.h:37
struct k_mutex rx_lock
Mutex protecting the input buffer access.
Definition shell_telnet.h:52
struct shell_telnet_line_buf line_out
Buffer for outgoing line.
Definition shell_telnet.h:40
bool output_lock
If set, no output is sent to the TELNET client.
Definition shell_telnet.h:64
struct zsock_pollfd fds[3]
Array for sockets used by the telnet service.
Definition shell_telnet.h:43
struct k_work_sync work_sync
Definition shell_telnet.h:61
uint8_t rx_buf[CONFIG_SHELL_CMD_BUFF_SIZE]
Input buffer.
Definition shell_telnet.h:46
size_t rx_len
Number of data bytes within the input buffer.
Definition shell_telnet.h:49
Unified shell transport interface.
Definition shell.h:646
Shell instance internals.
Definition shell.h:890
Definition of the monitored socket/file descriptor.
Definition socket_poll.h:28