Zephyr API Documentation
4.2.0-rc3
A Scalable Open Source RTOS
4.2.0-rc3
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Zephyr API Documentation
Introduction
Deprecated List
Topics
Data Structures
Files
File List
doc
kernel
lib
modules
subsys
zephyr
acpi
app_memory
arch
audio
bluetooth
canbus
console
crypto
data
debug
devicetree
dfu
display
drivers
dsp
dt-bindings
fs
input
internal
ipc
kernel
linker
llext
logging
lorawan
math
mem_mgmt
mgmt
misc
modbus
modem
multi_heap
net
platform
pm
pmci
portability
posix
psa
random
retention
rtio
sd
sensing
settings
shell
shell.h
shell_adsp_memory_window.h
shell_backend.h
shell_dummy.h
shell_fprintf.h
shell_history.h
shell_log_backend.h
shell_mqtt.h
shell_rpmsg.h
shell_rtt.h
shell_string_conv.h
shell_telnet.h
shell_types.h
shell_uart.h
shell_websocket.h
sip_svc
stats
storage
sys
task_wdt
timing
toolchain
tracing
usb
usb_c
xen
zbus
zvfs
bindesc.h
cache.h
device.h
devicetree.h
fatal.h
fatal_types.h
init.h
irq.h
irq_multilevel.h
irq_nextlevel.h
irq_offload.h
kernel.h
kernel_includes.h
kernel_structs.h
kernel_version.h
net_buf.h
shared_irq.h
smf.h
spinlock.h
sw_isr_table.h
sys_clock.h
syscall.h
toolchain.h
types.h
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
shell_history.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Nordic Semiconductor ASA
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_SHELL_HISTORY_H_
8
#define ZEPHYR_INCLUDE_SHELL_HISTORY_H_
9
10
#include <
zephyr/kernel.h
>
11
#include <
zephyr/sys/util.h
>
12
#include <
zephyr/sys/dlist.h
>
13
#include <
zephyr/sys/ring_buffer.h
>
14
#include <
stdbool.h
>
15
16
#ifdef __cplusplus
17
extern
"C"
{
18
#endif
19
20
21
struct
shell_history
{
22
struct
ring_buf
*
ring_buf
;
23
sys_dlist_t
list
;
24
sys_dnode_t
*
current
;
25
};
21
struct
shell_history
{
…
};
26
33
#define Z_SHELL_HISTORY_DEFINE(_name, _size) \
34
static uint8_t __noinit __aligned(sizeof(void *)) \
35
_name##_ring_buf_data[_size]; \
36
static struct ring_buf _name##_ring_buf = \
37
{ \
38
.size = _size, \
39
.buffer = _name##_ring_buf_data \
40
}; \
41
static struct shell_history _name = { \
42
.ring_buf = &_name##_ring_buf \
43
}
44
45
51
void
z_shell_history_init(
struct
shell_history
*history);
52
61
void
z_shell_history_purge(
struct
shell_history
*history);
62
68
void
z_shell_history_mode_exit(
struct
shell_history
*history);
69
82
bool
z_shell_history_get(
struct
shell_history
*history,
bool
up,
83
uint8_t
*dst,
uint16_t
*len);
84
95
void
z_shell_history_put(
struct
shell_history
*history,
uint8_t
*line,
96
size_t
len);
97
105
static
inline
bool
z_shell_history_active(
struct
shell_history
*history)
106
{
107
return
(history->
current
) ?
true
:
false
;
108
}
109
110
#ifdef __cplusplus
111
}
112
#endif
113
114
#endif
/* ZEPHYR_INCLUDE_SHELL_HISTORY_H_ */
dlist.h
sys_dnode_t
struct _dnode sys_dnode_t
Doubly-linked list node structure.
Definition
dlist.h:54
sys_dlist_t
struct _dnode sys_dlist_t
Doubly-linked list structure.
Definition
dlist.h:50
kernel.h
Public kernel APIs.
ring_buffer.h
stdbool.h
true
#define true
Definition
stdbool.h:14
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
uint16_t
__UINT16_TYPE__ uint16_t
Definition
stdint.h:89
shell_history
Definition
shell_history.h:21
shell_history::current
sys_dnode_t * current
Definition
shell_history.h:24
shell_history::ring_buf
struct ring_buf * ring_buf
Definition
shell_history.h:22
shell_history::list
sys_dlist_t list
Definition
shell_history.h:23
util.h
Misc utilities.
zephyr
shell
shell_history.h
Generated on
for Zephyr API Documentation by
1.14.0