10#include <zephyr/shell/shell.h>
11#include <zephyr/bluetooth/conn.h>
13#include <zephyr/sys/ring_buffer.h>
44#define SHELL_BT_NUS_DEFINE(_name, _tx_ringbuf_size, _rx_ringbuf_size) \
45 static struct shell_bt_nus_ctrl_blk _name##_ctrl_blk; \
46 RING_BUF_DECLARE(_name##_tx_ringbuf, _tx_ringbuf_size); \
47 RING_BUF_DECLARE(_name##_rx_ringbuf, _rx_ringbuf_size); \
48 static const struct shell_bt_nus _name##_shell_bt_nus = { \
49 .ctrl_blk = &_name##_ctrl_blk, \
50 .tx_ringbuf = &_name##_tx_ringbuf, \
51 .rx_ringbuf = &_name##_rx_ringbuf, \
53 struct shell_transport _name = { \
54 .api = &shell_bt_nus_transport_api, \
55 .ctx = (struct shell_bt_nus *)&_name##_shell_bt_nus \
const struct shell_transport_api shell_bt_nus_transport_api
void shell_bt_nus_enable(struct bt_conn *conn)
Enable the NUS shell transport instance.
int shell_bt_nus_init(void)
Initialize the NUS shell transport instance.
void shell_bt_nus_disable(void)
Disable the NUS shell transport instance.
struct bt_conn * conn
Definition: shell_bt_nus.h:30
atomic_t tx_busy
Definition: shell_bt_nus.h:31
void * context
Definition: shell_bt_nus.h:33
shell_transport_handler_t handler
Definition: shell_bt_nus.h:32
Instance control block (RW data).
Definition: shell_bt_nus.h:29
struct ring_buf * rx_ringbuf
Definition: shell_bt_nus.h:40
struct shell_bt_nus_ctrl_blk * ctrl_blk
Definition: shell_bt_nus.h:38
struct ring_buf * tx_ringbuf
Definition: shell_bt_nus.h:39
Instance structure.
Definition: shell_bt_nus.h:37