porting: Add common function to run default event queue

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.
This commit is contained in:
Andrzej Kaczmarek
2018-05-24 12:03:43 +02:00
parent 095288a549
commit 4c70f15a74
2 changed files with 13 additions and 0 deletions
@@ -28,6 +28,8 @@ extern "C" {
void nimble_port_init(void);
void nimble_port_run(void);
struct ble_npl_eventq *nimble_port_get_dflt_eventq(void);
#if NIMBLE_CFG_CONTROLLER
+11
View File
@@ -54,6 +54,17 @@ nimble_port_init(void)
#endif
}
void
nimble_port_run(void)
{
struct ble_npl_event *ev;
while (1) {
ev = ble_npl_eventq_get(&g_eventq_dflt, BLE_NPL_TIME_FOREVER);
ble_npl_event_run(ev);
}
}
struct ble_npl_eventq *
nimble_port_get_dflt_eventq(void)
{