I’m looking at the C / C++ example interface code here: https://github.com/mavlink/c_uart_interface_example. Looking in the serial_port files, it’s setup so that the port cannot be read from and written to simultaneously (the writing thread and reading thread have to acquire a lock before doing their business).
Why is it done like that? Is it an inherent limitation? Searching on google has mixed answers - some say it’s possible, others say it’s not. It should be possible since UARTs are full-duplex right?
I’m also curious how this affects performance, particularly given that only a single byte is read at a time (i.e. having to acquire the lock before each and every byte is read).
Thanks in advance.