v01d commented on pull request #1661:
URL: https://github.com/apache/incubator-nuttx/pull/1661#issuecomment-693743460


   > > Debugging leads me here:
   > > 
https://github.com/apache/incubator-nuttx/blob/18cae2e78a7f4ab61a34e4e66b6b272d96b8e1a3/net/bluetooth/bluetooth_sockif.c#L909
   > > 
   > > And at that point since I'm trying to use BTPROTO_HCI this is not yet 
supported. As I mentioned nimBLE implements L2CAP on ther own so they produce 
HCI commands to be sent via the socket directly.
   > 
   > That is correct BTPROTO_HCI in the **NuttX** stack is not implemented. 
That is what this PR will done when it is complete, but right now it is just 
stubbed out.
   > 
   > Are you trying to run the nimble stack on top of NuttX? To do that we 
would need to implement the USER or RAW channels for BTPROTO_HCI. These were 
low priority for me because they bypass the kernel, instead userspace would use 
the L2CAP for GATT and (BTPROTO_HCI -- CONTROL_CHANNEL) for doing things like 
setting advertisements, scanning, etc...
   
   Correct. Sorry, I think I didn't gave enough context. I started last week 
looking into how to adapt NuttX host layer to work with L2CAP sockets, as I 
mentioned ealier here, but felt a bit overwhelmed and didn't know how to start. 
In the meantime, I stumbled upon nimBLE and realized that as it supports linux 
via RAW HCI sockets, considering you just added support for HCI using the sim, 
I thought maybe I could try to port nimBLE (at least to have another option for 
a host layer and also because it seemed a less daunting task).
   
   So I understand that supporting RAW HCI socket would not be part of this PR 
since you would implement the control channel and the rest of the communication 
would happen over L2CAP socket, right? 
   Maybe I can see if it isn't too difficult to add the RAW option. Anyway, 
maybe it is best that I wait until this is merged, otherwise we would step on 
each other.
   
   > 
   > What I was asking about was what interfaces were you running into that 
l2cap did not provide for creating the real NuttX GATT server/client? Because 
we could make sure to implement those first (should be one of the mgmt APIs 
that I pointed out)
   
   Well, the first point is that NuttX host layer should become a userspace 
library that abstracts L2CAP socket access. So to do that, the point of contact 
with L2CAP, at the ATT layer, needs to be modified to interfaces via sockets 
not direct calls. The point is that this change bubbles up to the GATT 
functions, since there's some structures used to identify an L2CAP connection 
all the way to the top of the host layer. Since now this would be replaced with 
a socket fd possibly, I didn't know how to proceed since the change will 
probably be quite massive.
   Besides this transformation, I also noticed that there does not seem to be a 
way to define a GATT server. The macros and such to declare a service are 
there, but I think there's something missing that takes a GATT service 
definition and creates the server itself.
   
   Do note that I'm not really familiar with all of this, I'm learning as I go, 
so maybe I'm confused in some areas.


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to