This is example configuration used by RIOT, mostly due to CI complaining
about this file since it does not follow RIOT style at all (it is
autogenerated by newt).
Other applications built for RIOT can decide simply not to use this file
and provide own instead.
This patch adds NPL for RIOT, see https://www.riot-os.org/.
Example applications are included in RIOT sources and should be build
from there. RIOT build system will automatically fetch NimBLE sources as
a package.
Perhaps we need to figure out better way to sync these files with core,
but for now let's do this manually. Anyway, I do not expect this to
happen very often.
Now application can just call single function which will run default
event queue instead of creating "standard" loop. Also on some OS it may
be just possible to call some OS-specific API instead, so it's up to app
what to do - this is just a convenience function.
OS specific code should not care about default event queue thus it will
be created by nimble_port_init() function internally. We'll just add
simple getter in case someone wants to use it.
This makes more sense since now we have API which can just fire callback
associated with event. Running eventq is just getting an event from
queue and then running it.
nRF5 SDK (v15) is required to run this demo app. By default, it is
expected to be available at porting/examples/freertos_nrf5_sdk/nrf5_sdk
but this location can be changed by SDK_ROOT variable.
To build for nRF52832:
> cd porting/examples/freertos_nrf5_sdk
> make -C pca10040/blank/armgcc
To build for nRF52840:
> cd porting/examples/freertos_nrf5_sdk
> make -C pca10056/blank/armgcc
To build with nRF5 SDK placed in non-default location:
> cd porting/examples/freertos_nrf5_sdk
> make -C pca10040/blank/armgcc SDK_ROOT=/xxx/nRF5_SDK_15.0.0_a53641a
Flashing is done as for other examples in nRF5 SDK:
> make -C pca10040/blank/armgcc flash
We should only initialize basic NimBLE packages in common init. Extra
services should be better initialized by application since we do not
know which ones it may want to include.
"is_active" is more consistent with other APIs naming like "is_empty" or
"is_queued". Also "active" instead of "queued" makes more sense since
this means callout is active and can fire on timeout. "queued" is just
related to implementation on Mynewt where active callout is put on
queue.
Return value is also changes for consistency.
Let's just add timeout parameter to os_eventq_get instead and have
single API to get event from queue. The handing of timeout can be
optimied by compiler if static inline is used to implement this.
Currently nimble_npl_os.h is included before APIs are declared. This is
to make sure all OS-specific types are defined early since they are
needed for APIs declaration. This has a nice side effect since we can
simply define some simple APIs as static inlines in nimble_npl_os.h and
later declarations will simply inherit linkage of prior symbol, thus no
error is emitted. As a result, we do not need BLE_NPL_STORAGE_DECL thus
let's just remove it.