nuttx/arch/sim/src
fangzhenwei e4ed6156ca arch/sim: fix incomplete HCI socket data reading in simulator interrupt handler
The sim_bthcisock_interrupt() handler for Bluetooth HCI sockets in the simulatorwas using
an if statement to check for available data on the HCI socket. Thismeant that only a single
packet would be read and processed per interrupt trigger,even if multiple packets were waiting
in the socket buffer.

This led to incomplete data processing: unread packets would remain in the bufferuntil the next
interrupt tick, causing delayed handling of Bluetooth HCI events/commands,packet backlogs,
or missed data in high-throughput scenarios.

This fix replaces the if with a while loop to:

1. Continuously check for and read available data from the HCI socket until no more
   packets are present in the buffer.
2. Ensure all pending HCI packets are processed in a single interrupt handler invocation.
3. Eliminate packet backlogs and reduce latency in Bluetooth HCI communication.

The change maintains the same core data reception logic (bthcisock_receive()) butensures it runs
for all available packets, improving the reliability and responsivenessof the simulator's Bluetooth HCI socket implementation.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2026-02-26 08:15:28 -03:00
..
cmake cmake(bugfix):fix sim loadable elf build support 2026-01-19 14:45:37 +08:00
sim arch/sim: fix incomplete HCI socket data reading in simulator interrupt handler 2026-02-26 08:15:28 -03:00
.gitignore arch/sim: Copy include/nuttx/config.h to the local folder 2021-07-27 07:44:33 +09:00
CMakeLists.txt cmake:add missing cflag "-D_FILE_OFFSET_BITS=64" of sim 2025-12-18 22:18:49 +08:00
Makefile Makefile: Remove make depend files by make distclean 2026-02-16 16:27:57 +01:00
nuttx-names.in arch/sim: Add sigdelset to nuttx-names.in 2026-01-31 14:14:32 +08:00