zephyr/subsys/shell
Marcin Niestroj 79fa92229a mgmt: smp: shell: use net_buf API for storing UART SMP fragments
So far there was a simple char array used as buffer, with additional
variable representing number of bytes already written into it. After
full frame was written, a boolean flag was simply set to notify thread
about being ready to be processed. There was however no mechanism
implemented to prevent new incoming bytes from overwriting such buffer
before (or during) being processed.

Use net_buf to store temporary frame. Define dedicated net_buf_pool,
from which such buffer will be allocated and freed after being
processed. This will prevent from reusing the same buffer before having
it fully processed (and returning once again to available buffer pool)
in shell thread.

Define also fifo that will store buffers that are ready to be
processed. This will be the mechanism for notifying thread about new
UART SMP fragments.

net_buf pool and k_fifo are used on purpose, keeping in mind their
additional overhead (mostly in RAM/ROM usage). This makes the code ready
for increasing number of buffers if needed. In this commit however we
stick with only 1 buffer, to keep minimal changes in processing flow.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-07 14:51:06 +02:00
..
modules device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
CMakeLists.txt
Kconfig shell: add argc range in Kconfig 2020-09-18 15:18:07 +02:00
Kconfig.backends shell: Fix typo in a comment 2020-09-15 09:44:42 -05:00
Kconfig.template.shell_log_queue_size
Kconfig.template.shell_log_queue_timeout
shell_cmds.c shell: enhance help command 2020-10-02 12:05:49 -04:00
shell_dummy.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
shell_fprintf.c shell: support floating point output with newlib 2020-09-03 21:53:09 +02:00
shell_help.c shell: help functions update 2020-10-02 12:05:49 -04:00
shell_help.h shell: help functions update 2020-10-02 12:05:49 -04:00
shell_history.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
shell_log_backend.c guideline: Make explicit fallthrough cases 2020-08-24 20:28:47 -04:00
shell_ops.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
shell_ops.h shell_ops: simplify flag_xxx_get functions 2020-08-18 10:44:35 -04:00
shell_rtt.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
shell_telnet_protocol.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
shell_telnet.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
shell_uart.c mgmt: smp: shell: use net_buf API for storing UART SMP fragments 2020-10-07 14:51:06 +02:00
shell_utils.c shell: improve function shell_cmd_get 2020-10-02 12:05:49 -04:00
shell_utils.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
shell_vt100.h
shell_wildcard.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
shell_wildcard.h
shell.c shell: help functions update 2020-10-02 12:05:49 -04:00