An Chao, thanks for the very detailed explanation of how Xiaomi has approach the BLE stack in NuttX, it is quite useful to know when discussing this. However, I agree with Brennan that it is better to maintain compatibility with Linux by exposing the stack via sockets.
Best, Matias On Wed, Aug 26, 2020, at 07:48, Brennan Ashton wrote: > > > On Wed, Aug 26, 2020, 3:31 AM 安超 <anc...@xiaomi.com.invalid> wrote: >> >> >> Hi Greg, Matias, >> >> The current implementation of Xiaomi’s Bluetooth stack is different with the >> current architecture. >> HCI transport layer communication will be based on /dev/ttyS* devices >> instead of sockets, >> >> >> >> The stack module prefers like bluedroid instead of bluez, host/l2cap will >> run on userspace, > > While I appreciate the need to have a more complete Bluetooth stack working, > I am very opposed to this being brought into mainline. It fully bypasses the > OS. This would be as if we implemented the full network stack in user space. > > Doing this also ties us to a critical bit of software that we do not maintain > which is also not something I could support. > > The Bluedroid comparison is a good one, it exists to explicitly work around > the Linux stack and further sperate Android from the kernel. This split also > let Qualcomm ship there entirely own stack also out of the Kernel. > > > What I will say is that once I implement the HCI socket interface, using the > user channel you could easily have zblue run on top of that with no changes > to NuttX. Drivers do not have to implement a special tty interface since it > can just use the socket interface. This is the whole point of the user > channel and how several years ago I added mesh support outside of the Linux > kernel. > > --Brennan > > *Attachments:* > * bt4.png