btstack_run_loop: add btstack_run_loop_set_data_source_handle and btstack_run_loop_get_data_source_handle (for windows)

This commit is contained in:
Matthias Ringwald 2018-07-05 22:54:18 +02:00
parent d504181a0a
commit f04a41aef7
2 changed files with 23 additions and 0 deletions

View File

@ -81,6 +81,14 @@ int btstack_run_loop_get_data_source_fd(btstack_data_source_t *ds){
return ds->fd;
}
void btstack_run_loop_set_data_source_handle(btstack_data_source_t *ds, void * handle){
ds->handle = handle;
}
void * btstack_run_loop_get_data_source_handle(btstack_data_source_t *ds){
return ds->handle;
}
void btstack_run_loop_enable_data_source_callbacks(btstack_data_source_t *ds, uint16_t callbacks){
btstack_run_loop_assert();
if (the_run_loop->enable_data_source_callbacks){

View File

@ -173,6 +173,21 @@ void btstack_run_loop_set_data_source_fd(btstack_data_source_t * data_source, in
*/
int btstack_run_loop_get_data_source_fd(btstack_data_source_t * data_source);
/**
* @brief Set data source file descriptor.
* @param data_source
* @param handle
* @note No effect if port doensn't have file descriptors
*/
void btstack_run_loop_set_data_source_handle(btstack_data_source_t * data_source, void * handle);
/**
* @brief Get data source file descriptor.
* @param data_source
*/
void * btstack_run_loop_get_data_source_handle(btstack_data_source_t * data_source);
/**
* @brief Enable callbacks for a data source
* @param data_source to remove