mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-19 15:40:52 +00:00
btstack_run_loop_base: add btstack_run_loop_base_poll_data_sources
This commit is contained in:
parent
9111a8ae53
commit
3af29ae530
@ -126,3 +126,15 @@ int32_t btstack_run_loop_base_get_time_until_timeout(uint32_t now){
|
||||
}
|
||||
return delta;
|
||||
}
|
||||
|
||||
void btstack_run_loop_base_poll_data_sources(void){
|
||||
// poll data sources
|
||||
btstack_data_source_t *ds;
|
||||
btstack_data_source_t *next;
|
||||
for (ds = (btstack_data_source_t *) btstack_run_loop_base_data_sources; ds != NULL ; ds = next){
|
||||
next = (btstack_data_source_t *) ds->item.next; // cache pointer to next data_source to allow data source to remove itself
|
||||
if (ds->flags & DATA_SOURCE_CALLBACK_POLL){
|
||||
ds->process(ds, DATA_SOURCE_CALLBACK_POLL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -120,6 +120,11 @@ void btstack_run_loop_base_enable_data_source_callbacks(btstack_data_source_t *
|
||||
*/
|
||||
void btstack_run_loop_base_disable_data_source_callbacks(btstack_data_source_t * data_source, uint16_t callbacks);
|
||||
|
||||
/**
|
||||
* @brief Poll data sources. It calls the procss function for all data sources where DATA_SOURCE_CALLBACK_POLL is set
|
||||
*/
|
||||
void btstack_run_loop_base_poll_data_sources(void);
|
||||
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user