From efef2dd3af63dc75e950b1fde8cd10fccbdb5d40 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 20 Apr 2023 11:20:05 +0200 Subject: [PATCH] btstack_uart_posix: assert no pending read/write opration --- platform/posix/btstack_uart_posix.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/posix/btstack_uart_posix.c b/platform/posix/btstack_uart_posix.c index 91b2255a8..68fe8a4cf 100644 --- a/platform/posix/btstack_uart_posix.c +++ b/platform/posix/btstack_uart_posix.c @@ -380,6 +380,8 @@ static void btstack_uart_posix_set_block_sent( void (*block_handler)(void)){ } static void btstack_uart_posix_send_block(const uint8_t *data, uint16_t size){ + btstack_assert(btstack_uart_block_write_bytes_len == 0); + // setup async write btstack_uart_block_write_bytes_data = data; btstack_uart_block_write_bytes_len = size; @@ -387,6 +389,9 @@ static void btstack_uart_posix_send_block(const uint8_t *data, uint16_t size){ } static void btstack_uart_posix_receive_block(uint8_t *buffer, uint16_t len){ + btstack_assert(btstack_uart_block_read_bytes_len == 0); + + // setup async read btstack_uart_block_read_bytes_data = buffer; btstack_uart_block_read_bytes_len = len; btstack_run_loop_enable_data_source_callbacks(&transport_data_source, DATA_SOURCE_CALLBACK_READ);