nuttx/Documentation
Lingao Meng 89c4b8ccaf
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
arch/sim: Add runtime HCI socket target option
Allow sim HCI socket users to select the host-side HCI target at runtime
with --bt-dev.  Passing --bt-dev=hciN overrides CONFIG_SIM_HCISOCKET_DEVID
for the BlueZ HCI user channel, while omitting the option keeps the existing
configured default behavior.

Also allow --bt-dev=/path/to/socket to connect to an H:4 stream exposed
through a Unix-domain socket.  This lets sim applications use a controller
provided by another host process or by a UART-to-Unix-socket bridge without
requiring BlueZ raw HCI privileges for the NuttX process.

Use host-side output for early --bt-dev parse errors, since NuttX stdio is
not initialized before nx_start().

Document the BlueZ and Unix socket modes, including the capability
requirements for BlueZ and the socat bridge example for Unix socket mode.

Testing:

  Host: Ubuntu 22.04 x86_64
  Board/config: sim:bthcisock

  Style checks:

    git diff --check HEAD~2..HEAD
    PATH=/home/mi/bsim-auto-test/.venv/bin:$PATH \
      ./tools/checkpatch.sh -c -u -m -g HEAD~2..HEAD

  Clean build:

    make distclean
    ./tools/configure.sh -l -a ../../nuttx-apps sim:bthcisock
    kconfig-tweak --file .config --set-val STACK_USAGE_WARNING 0
    make olddefconfig
    make -j16

  Invalid runtime argument smoke test:

    ./nuttx --bt-dev=invalid

  Verified the command exits with status 1 and reports the invalid target
  without crashing before nx_start().

  Unix socket HCI smoke test:

    socat -d -d UNIX-LISTEN:/tmp/hci.sock,fork,reuseaddr \
      /dev/ttyACM2,b1000000,raw,echo=0,crtscts=1
    printf 'ifconfig\nbt bnep0 info\npoweroff\n' | \
      timeout 20s ./nuttx --bt-dev=/tmp/hci.sock

  Verified the sim registers the Bluetooth network device as bnep0 and
  bt bnep0 info reads the controller state through the Unix-socket HCI
  path, including BDAddr aa:bb:cc:dd:ee:ff from the attached controller.

Assisted-by: OpenAI Codex
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-09-13 18:31:59 -03:00
..
_extensions Documentation: port warnings_filter Sphinx extension from Zephyr 2023-11-28 09:18:29 -08:00
_static
_templates
applications Documentation/applications/system/nxinit: document the "console" option 2026-09-10 09:26:33 +02:00
components Documentation, tools/ci: Say where the NXFLAT tools actually come from. 2026-09-13 18:29:40 -03:00
contributing !arch/stm32: move stm32l1 and finalize the directory split 2026-06-24 14:54:44 -03:00
debugging Documentation: Add documentation of SCHED_DUMP_TASKS and SCHED_DUMP_STACK 2026-06-09 08:04:54 -04:00
faq !boards: Remove NSH_ARCHINIT and board_app_initialize 2026-05-02 18:36:46 +08:00
guides Documentation/stm32h5: WWDG is supported. 2026-08-28 08:10:17 +08:00
implementation Documentation/critmon: Document context-switch accounting. 2026-09-08 08:30:45 +02:00
introduction Documentation: Point the buildroot links at the repository that still exists. 2026-09-13 18:29:40 -03:00
logos style: fix typos 2025-04-30 13:45:46 +08:00
platforms arch/sim: Add runtime HCI socket target option 2026-09-13 18:31:59 -03:00
quickstart Documentation: fill in pass1 directory description in organization.rst 2026-07-06 10:18:42 -03:00
reference arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
ReleaseNotes Documentation: add NuttX 13.0.1 release notes 2026-08-12 21:53:28 +08:00
standards fs: rename PSEUDOFS_SOFTLINKS to FS_LINKS 2026-08-27 01:12:33 +08:00
testing Documentation: add instructions how to run NTFC locally 2026-09-02 11:44:23 -03:00
.gitignore docs/tags: Introduce tagging feature to the documentation. 2025-04-29 09:18:25 +02:00
conf.py Documentation: conf: Ignore .venv 2026-05-29 01:26:21 +08:00
glossary.rst
index.rst docs/security: Add Security section to the documentation. 2026-01-06 02:17:20 +08:00
known-warnings.txt fs: Add VFS docs 2024-02-20 18:28:09 -08:00
legacy_README.md Documentation: Point the buildroot links at the repository that still exists. 2026-09-13 18:29:40 -03:00
make.bat
Makefile doc: Improve sphinx build time + add autobuild help info. 2026-01-27 09:50:55 +08:00
Pipfile docs/plantuml: Add PlantUML support to Documentation build 2026-02-15 08:47:23 +01:00
Pipfile.lock build(deps): bump starlette from 1.0.1 to 1.3.1 in /Documentation 2026-06-18 12:49:49 -04:00
security.rst docs/security: Add Security section to the documentation. 2026-01-06 02:17:20 +08:00
substitutions.rst Remove the double blank line from source files 2022-02-20 20:10:14 +01:00