LingaoM commented on issue #21478:
URL: https://github.com/apache/nuttx/issues/21478#issuecomment-6674019732

   > Could you confirm that BSWorld can drive a NuttX sim host over H4 today, 
and which controller you would use for it?
   
   Yes—BSWorld already supports a NuttX `sim` host over **standard H4 HCI 
carried by a Unix-domain socket**. For the per-commit LE regression job, I 
recommend the **Python 
[BSController](https://github.com/XiaoMi/bsworld/tree/main/components/bscontroller)**.
   
   The existing NuttX integration launches each host with `--bt-dev=<controller 
socket>` and the `--sim-bsim-*` arguments that join the shared simulation 
clock; see the [process 
helper](https://github.com/XiaoMi/bsworld/blob/main/tests/integration/nuttx/common/__init__.py#L50-L57).
 This uses NuttX's existing [`CONFIG_SIM_HCISOCKET` 
transport](https://github.com/apache/nuttx/blob/master/arch/sim/Kconfig#L676-L687).
 There are already scenarios for:
   
   - [`sim:bthcisock` / 
BTSak](https://github.com/XiaoMi/bsworld/blob/main/tests/integration/nuttx/btsak/test_btsak_scan_advertise.py):
 advertising, scanning, multiple advertisers, and interference/recovery.
   - 
[`sim:nimble`](https://github.com/XiaoMi/bsworld/blob/main/tests/integration/nuttx/nimble/test_central_peripheral.py):
 discovery, connection, GATT service discovery, and notification subscription.
   
   Those scenarios are [parameterized over both Python and Zephyr 
Controllers](https://github.com/XiaoMi/bsworld/blob/main/tests/integration/controllers.py).
 So the NuttX sim/H4 integration exists today; the new `sim:zblue` 
configuration and BTP application still need their own integration and 
regression scenarios. For deterministic execution, the NuttX build should also 
enable `CONFIG_SIM_BSIM_TIME`, as in the [existing NuttX 
setup](https://github.com/XiaoMi/bsworld/blob/main/tests/integration/nuttx/btsak/README.md#build-and-run).
   
   I recommend the Python implementation because it removes the need to fetch a 
Zephyr workspace, install its SDK, and build a Zephyr Controller image for this 
CI job. The Controller itself runs directly as Python code and needs no 
separate firmware compilation. BabbleSim's native PHY and libraries are still 
required, but those can be built once and reused. The [BSController CI 
workflow](https://github.com/XiaoMi/bsworld/blob/main/.github/workflows/bscontroller.yml)
 demonstrates installation, unit tests, and HCI/LL protocol tests without a 
Zephyr build.
   
   To support stability, I have added [unit 
tests](https://github.com/XiaoMi/bsworld/tree/main/components/bscontroller/tests/unit)
 and an independently implemented [protocol regression 
suite](https://github.com/XiaoMi/bsworld/blob/main/components/bscontroller/tests/qualification/PROTOCOL.md)
 containing **612 selected cases: 133 HCI and 479 LL**, based on the Bluetooth 
test specifications. These provide development regression coverage; they do not 
imply complete specification coverage or Bluetooth SIG qualification. BSWorld 
also has [interoperability 
scenarios](https://github.com/XiaoMi/bsworld/blob/main/tests/integration/zephyr/shell/shell_peer/README.md)
 between Python BSController and Zephyr's Controller over the shared BabbleSim 
PHY, with both Central/Peripheral role assignments, covering GATT, encryption, 
privacy, and link updates.
   
   The current [feature 
coverage](https://github.com/XiaoMi/bsworld/blob/main/components/bscontroller/README.md#supported-features)
 is mainly LE functionality introduced through **Bluetooth Core 5.0**, 
including extended/periodic advertising, LE 2M/Coded PHY, privacy, encryption, 
and data length extension, plus a few newer features. It does **not support 
BR/EDR**, so the BR/EDR parts of the roadmap will need a different 
Controller/backend or hardware. We can extend the Python implementation 
together as additional LE features are needed.
   
   I have also upstreamed the C-based virtual Controller as Zephyr's 
[`samples/bluetooth/hci_virt`](https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/bluetooth/hci_virt),
 which runs on `nrf52_bsim` and exposes the same H4 socket interface. BSWorld 
[supports either 
implementation](https://github.com/XiaoMi/bsworld/blob/main/docs/controllers.md),
 so we can use Python BSController for routine LE CI and retain Zephyr 
Controller runs for additional validation.
   
   For PR 7, I would reuse the existing NuttX sim transport, attach `sim:zblue` 
to Python BSController, and add the host-focused GAP/GATT scenarios around the 
BTP tester. AutoPTS can drive that tester separately in the hardware 
qualification setup.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to