Bluetooth: userchan: Support other libCs

Refactor the userchan driver into a top and a bottom part.
The bottom is the one which interacts with the host and is built
with the host libC, while the top is built with the embedded code
and whatever libC that is built with.

Errors (errno) is converted between the top and bottom to ensure they
are coherent with the local libC.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2025-02-26 16:36:32 +01:00 committed by Benjamin Cabé
commit b2b6f3c314
5 changed files with 153 additions and 91 deletions

View file

@ -175,6 +175,7 @@ config BT_USERCHAN
depends on (BOARD_NATIVE_POSIX || BOARD_NATIVE_SIM)
default y
depends on DT_HAS_ZEPHYR_BT_HCI_USERCHAN_ENABLED
select NATIVE_USE_NSI_ERRNO
help
This driver provides access to the local Linux host's Bluetooth
adapter using a User Channel HCI socket to the Linux kernel. It