patacongo commented on issue #1639:
URL: 
https://github.com/apache/incubator-nuttx/issues/1639#issuecomment-682148993


   > Do you think it would be reasonable to adapt this interface?
   
   My preference would not be to make any major redesign of the networking.  
Change struct sock_intf_s effects everything.  I don't think that is called 
for.  I think it only requires extension of the existing interface.
   
   The si_setup() method is the one that configures the socket for the address 
family, socket type, and protocol.  That is where the additional protocols and 
channels would have to be handled.  But I think it need only retain this 
information in struct bluetooth_conn_s which part of the socket data structure 
that holds information unique to an address family.
   
   For Bluetooth sockets, none of this information matters until we get to the 
network driver layer.  I don't think that the selected Bluetooth protocol 
necessarily has any impact on the network itself.  However, when a frame is 
sent or received, then it does effect the network driver and Bluetooth stack 
significantly.
   
   I think it is l2 layer where the additional protocols would have to be 
implemented; I think the socket layer just has to verify and remember the 
protocol and channel and coordinate this with the network driver / bluetooth 
stack.
   
   NOTE:  I tend to refer everything below the logic under net/ as L2.  The 
architecture is odd for Bluetooth because the Bluetooth stack is not integrated 
into the NuttX network stack.  Normally, the network driver is at the L2 layer, 
but not here.  The network driver sits above the Bluetooth stack and the entire 
Bluetooth stack is treated as the MAC sub-layer.  This is a little unusual, but 
I think think is a good partitioning.
   
   It was originally done that way to support 6LoWPAN sockets on top of L2CAP.
   
   struct sock_intf_s is the interface between the _user_ BSD sockets and the 
per-address-family socket implementation.  I don't think that should change.  I 
think the changes need to be in struct netdriver_s which is the interface 
between the network and the Bluetooth network driver and stack.
   
   It is only the Bluetooth network driver that can tap into the Bluetooth 
stack to support each protocol;  It is only the Bluetooth stack that can manage 
the channel behavior.
   
   Therefore, nothing much of substance has to change under net/.  All of the 
changes have to occur in the interface between net/ and the network drivers, in 
the network driver, and the Bluetooth 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:
[email protected]


Reply via email to