Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions subsys/mgmt/mcumgr/transport/src/smp_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ static struct smp_transport smp_shell_transport;

static struct mcumgr_serial_rx_ctxt smp_shell_rx_ctxt;

static const struct shell_uart_common *shell_uart;

#ifdef CONFIG_SMP_CLIENT
static struct smp_client_transport_entry smp_client_transport;
#endif
Expand Down Expand Up @@ -210,11 +212,10 @@ static uint16_t smp_shell_get_mtu(const struct net_buf *nb)

static int smp_shell_tx_raw(const void *data, int len)
{
static const struct device *const sh_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_shell_uart));
const uint8_t *out = data;

while ((out != NULL) && (len != 0)) {
uart_poll_out(sh_dev, *out);
uart_poll_out(shell_uart->dev, *out);
++out;
--len;
}
Expand All @@ -226,6 +227,7 @@ static int smp_shell_tx_pkt(struct net_buf *nb)
{
int rc;

shell_uart = (struct shell_uart_common *)shell_backend_uart_get_ptr()->iface->ctx;
rc = mcumgr_serial_tx_pkt(nb->data, nb->len, smp_shell_tx_raw);
smp_packet_free(nb);

Expand Down
Loading