You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/01/19 13:22:16 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #2720: board/sim: Support NuttX BLE stack through uart shim driver

xiaoxiang781216 commented on pull request #2720:
URL: https://github.com/apache/incubator-nuttx/pull/2720#issuecomment-762835680


   > I'm not entirely convinced that the serial interface is better than the socket interface. I also don't really see much benefit of replacing it with something that involves more layers in between.
   
   The packet transfered by socket is actually H4(UART) packet:
   https://github.com/apache/incubator-nuttx/pull/2720/files#diff-cca4f6c2d4ffd2eac608b4ae978781ae34f011e20a4bab939ade11d7ca38dc3aL97-L116
   https://github.com/apache/incubator-nuttx/pull/2720/files#diff-cca4f6c2d4ffd2eac608b4ae978781ae34f011e20a4bab939ade11d7ca38dc3aL218-L237
   So it is more natural and correct to expose it through bt_uart driver and then reuse the same packet/unpacket logic for us:
   https://github.com/apache/incubator-nuttx/blob/master/drivers/wireless/bluetooth/bt_uart.c#L209-L222
   https://github.com/apache/incubator-nuttx/blob/master/drivers/wireless/bluetooth/bt_uart.c#L315-L332
   
   > I'm curious what is the benefit you see on the tty interface over the socket based one.
   
   we can support both NuttX BLE stack and external BT/BLE stack with the same tty driver:
   
   1. NuttX BLE stack talk with the uart shim driver
   2. External BT/BLE stack talk with the tty driver
   
   More important, we can create a tty bridge driver to support BT and BLE stack from the different provider:
   
   1. Without modifyingthe hardware driver
   2. Without modifying the BT or BLE stack too
   
   like this:
   ```
   /dev/ttyHCI-BT bridge-+-/dev/ttyBT---Android bluedroid
                         |-/dev/ttyBLE--NuttX native stack
   ```
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org