v01d opened a new issue #864:
URL: https://github.com/apache/mynewt-nimble/issues/864


   I'm experimenting with porting nimBLE to NuttX. We're in the process of 
completing a Linux-like socket interface via BTPROTO_HCI and BTPROTO_L2CAP. 
There's already a host layer on NuttX but I would like to try nimBLE as it 
already supports Linux and it shouldn't be much harder to support.
   
   I'm finding some issues that I wanted to mention, not sure if these are 
possibles areas of improvement of nimBLE or I'm simply not fully understanding 
how to do the port (I couldn't find any documentation). 
   
   For starters, I copied linux/ in npl/ and modified it to suit NuttX. As it 
is mostly Linux compatible, no big changes are needed. However one issue I find 
is that NuttX requires an initial include in every .c and .h as: `#include 
<nuttx/config.h>` which holds the output of the Kconfig configuration system. 
For the OS specific files in npl/ I can add this include, but for the rest of 
the code I would have to manually insert it everywhere. I imagine one way would 
be to extend the porting layer to have a header which would be included 
everywhere in nimBLE where I could add this include 
([LVGL](https://github.com/littlevgl/lvgl) for example does it this way).
   
   Another issue I find is there there are some macros which are not defined 
anywhere in nimBLE repo. For now I found (but I think there are many others):
   * NIMBLE_CFG_CONTROLLER
   * OS_CFG_ALIGN_4
   * OS_CFG_ALIGNMENT
   * BLE_LL_CFG_FEAT_LL_PRIVACY
   * LOG_LEVEL_*
   
   I'm sensing that there should be some configuration process for the port 
which defines these but it does not appear to be part of this repo (maybe done 
in mynewt repo?)
   
   I also started by attempting to build the linux "test" applications but it 
failed due to `ble_npl_eventq_run` not being declared. Maybe this test is not 
maintained? If you don't think it is reasonable to spend time trying to build 
this test I can skip it. I was now moving on to trying to build the linux 
"example".
   
   One final question: in Linux there's BTPROTO_L2CAP and on NuttX we're 
following the same path of exposing L2CAP over a socket. I see nimBLE only uses 
the HCI socket and solves L2CAP on its own. Is there any plan to make this 
optional and have BTPROTO_L2CAP sockets supported? This would not only better 
integrate nimble with NuttX but also Linux IMHO.
   
   That's it so far. If you could give me some points on the porting process it 
would really be helpful.


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