btstack_uart_posix: assert no pending read/write opration

This commit is contained in:
Matthias Ringwald 2023-04-20 11:20:05 +02:00
parent 6c9f72810b
commit efef2dd3af

View File

@ -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);