From b06f2fbcc7f244892d6e6009839ec40650a37502 Mon Sep 17 00:00:00 2001 From: Marko Kiiskila Date: Tue, 11 Sep 2018 13:16:45 +0300 Subject: [PATCH] ble_monitor; crashes if outputting uart receives any characters. Add a routine to discard the data instead. --- nimble/host/src/ble_monitor.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nimble/host/src/ble_monitor.c b/nimble/host/src/ble_monitor.c index 437b1104b..e6db48b82 100644 --- a/nimble/host/src/ble_monitor.c +++ b/nimble/host/src/ble_monitor.c @@ -71,6 +71,12 @@ inc_and_wrap(int i, int max) return (i + 1) & (max - 1); } +static int +monitor_uart_rx_discard(void *arg, uint8_t ch) +{ + return 0; +} + static int monitor_uart_tx_char(void *arg) { @@ -295,7 +301,7 @@ ble_monitor_init(void) .uc_parity = UART_PARITY_NONE, .uc_flow_ctl = UART_FLOW_CTL_NONE, .uc_tx_char = monitor_uart_tx_char, - .uc_rx_char = NULL, + .uc_rx_char = monitor_uart_rx_discard, .uc_cb_arg = NULL, };