Jackson-gjh opened a new pull request, #21536:
URL: https://github.com/apache/nuttx/pull/21536

   ## Summary
   
   Mark a Bluetooth netdev operational immediately after registration when it is
   used as a raw HCI transport for an external Host stack.
   
   ## Problem
   
   `bt_netdev_register()` leaves the carrier off. Normally `btnet_ifup()` turns
   it on after network configuration, but a raw HCI interface has no IP
   configuration step and never invokes `btnet_ifup()`.
   
   Consequently `IFF_RUNNING` remains clear:
   
   - received Controller events are dropped by `bt_netdev_receive()`;
   - HCI transmit notifications are ignored by `btnet_txavail_work()`.
   
   An external Host stack can therefore stall during Controller initialization.
   
   ## Fix
   
   Call `netdev_carrier_on()` after successful registration when
   `CONFIG_WIRELESS_BLUETOOTH_HOST` is disabled. The built-in Bluetooth Host and
   its existing `ifup`/`ifdown` lifecycle are unchanged.
   
   This complements the raw HCI receive-device lookup fix in #21535.
   
   ## Testing
   
   Hardware and versions:
   
   - ESP32-C6 revision v0.2
   - NuttX `43f7f34b995`
   - NuttX Apps `b3d9d96bf`
   - Apache NimBLE `3932e99f43041f28dcf25c42a0f06e4584774dd8`
   - Espressif HAL `cf95a27f2aa263d77c7a8d7f56007abfc899fc47`
   - `examples/nimble_bleprph`
   
   The receive lookup fix from #21535 and all temporary integration fixes were
   held constant. The two firmware images differed only in this carrier change.
   
   - Without the fix: Host initialization stalled and a 12-second active scan
     did not find `NuttX NimBLE PRPH`.
   - With the fix: advertising, connection, GATT service discovery and a Battery
     Level read succeeded.
   
   ```text
   connected=True
   service=00001811-0000-1000-8000-00805f9b34fb
   service=0000180f-0000-1000-8000-00805f9b34fb
   service=59462f12-9543-9999-12c8-58b459a2712d
   battery_level=25
   ```
   
   Device output included:
   
   ```text
   connection established; status=0
   mtu update event; conn_handle=0 cid=4 mtu=256
   disconnect; reason=531
   ```
   


-- 
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