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


   > > Right now it is calling `bt_hci_recieve` which I think needs to be 
changed to input the data to the networking layer and let the network driver 
figure how to process this, right? What is the interface I should use for this? 
Is it `bluetooth_input`? I'm guessing `bt_netdev.c` should be extended to be 
able to directly receive HCI packets and not only L2CAP packets via 
`btnet_l2cap_receive`.
   > 
   > Isn't this a problem similar to the Ethernet raw packet input? In that 
case, the driver does not call any of the *_input() functions, instead is calls 
a packet tap function (pkt_input()). The raw packet logic then decides of the 
packet is one that it should pick off or not. It returns an indication if the 
packet was consumed or not. If it was not consumed, then the network driver 
dispatches to a protocol-specific network stack input function.
   
   I will look into that. Most likely this would resemble more to how other 
networking drivers are handled. Right now the HCI socket support for sim taps 
into the HCI layer, registering itself as an HCI supporting device. I think 
that the right way would be to register a simulated network driver.
    
   > Can the network decide if the packet is an HCI packet based on the 
addressing in the packet and on some configured socket address?
   
   If you are interacting either with the host's bluetooth dongle or with the 
BT link-layer, you already know you have an HCI packet to send. If NuttX is 
built with its own host-layer enabled, it would be fed with bt_hci_receive() at 
some point. When using nimBLE the host stack would be disabled and the packet 
should reach the open HCI socket.
   Have a look at the PR once I open it, maybe it easier to understand looking 
at the code.
   
   


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