#include "btstack_run_loop.h"
#include <stdio.h>
#include <stdlib.h>
#include "btstack_debug.h"
#include "btstack_config.h"
Macros | |
#define | __BTSTACK_FILE__ "btstack_run_loop.c" |
Variables | |
const btstack_run_loop_t | btstack_run_loop_embedded |
static const btstack_run_loop_t * | the_run_loop = NULL |
#define __BTSTACK_FILE__ "btstack_run_loop.c" |
void btstack_run_loop_add_data_source | ( | btstack_data_source_t * | ds | ) |
Add data_source to run_loop.
Add data source to run loop.
References btstack_run_loop::add_data_source, btstack_run_loop_assert(), and log_error.
Referenced by btstack_stdin_setup(), and btstack_uart_block_freertos_init().
void btstack_run_loop_add_timer | ( | btstack_timer_source_t * | ts | ) |
Add timer to run_loop (keep list sorted)
Add timer source.
References btstack_run_loop::add_timer, and btstack_run_loop_assert().
Referenced by att_server_indicate(), atwilc3000_wait_for_reset_completed(), event_handler(), gap_random_address_update_handler(), gap_random_address_update_start(), gatt_client_timeout_start(), hci_initializing_run(), hci_transport_inactivity_timer_set(), hci_transport_link_set_timer(), heartbeat_handler(), le_counter_setup(), sm_aes128_start(), and sm_timeout_start().
|
static |
References log_error.
Referenced by btstack_run_loop_add_data_source(), btstack_run_loop_add_timer(), btstack_run_loop_disable_data_source_callbacks(), btstack_run_loop_enable_data_source_callbacks(), btstack_run_loop_execute(), btstack_run_loop_get_time_ms(), btstack_run_loop_remove_data_source(), btstack_run_loop_remove_timer(), btstack_run_loop_set_timer(), and btstack_run_loop_timer_dump().
void btstack_run_loop_disable_data_source_callbacks | ( | btstack_data_source_t * | data_source, |
uint16_t | callbacks | ||
) |
Enable callbacks for a data source.
data_source | to remove |
callback | types to disable |
References btstack_run_loop_assert(), btstack_run_loop::disable_data_source_callbacks, and log_error.
void btstack_run_loop_enable_data_source_callbacks | ( | btstack_data_source_t * | data_source, |
uint16_t | callbacks | ||
) |
Enable callbacks for a data source.
data_source | to remove |
callback | types to enable |
References btstack_run_loop_assert(), btstack_run_loop::enable_data_source_callbacks, and log_error.
Referenced by btstack_stdin_setup(), and btstack_uart_block_freertos_init().
void btstack_run_loop_execute | ( | void | ) |
Execute run_loop.
Execute configured run loop.
References btstack_run_loop_assert(), and btstack_run_loop::execute.
Referenced by bt_task().
int btstack_run_loop_get_data_source_fd | ( | btstack_data_source_t * | data_source | ) |
uint32_t btstack_run_loop_get_time_ms | ( | void | ) |
Get current time in ms.
References btstack_run_loop_assert(), and btstack_run_loop::get_time_ms.
Referenced by hci_transport_h5_block_received(), mdelay(), and printf_timestamp().
void* btstack_run_loop_get_timer_context | ( | btstack_timer_source_t * | ts | ) |
Get context for this timer.
References btstack_timer_source::context.
Referenced by att_handle_value_indication_timeout(), and sm_timeout_handler().
void btstack_run_loop_init | ( | const btstack_run_loop_t * | run_loop | ) |
Init main run loop.
Must be called before any other run loop call.
Use btstack_run_loop__get_instance() from btstack_run_loop_.h to get instance
References btstack_run_loop::init, and log_error.
int btstack_run_loop_remove_data_source | ( | btstack_data_source_t * | ds | ) |
Remove data_source from run loop.
Remove data source from run loop.
References btstack_run_loop_assert(), log_error, and btstack_run_loop::remove_data_source.
int btstack_run_loop_remove_timer | ( | btstack_timer_source_t * | ts | ) |
Remove timer from run loop.
Remove timer source.
References btstack_run_loop_assert(), and btstack_run_loop::remove_timer.
Referenced by att_packet_handler(), gap_random_address_update_stop(), gatt_client_timeout_start(), gatt_client_timeout_stop(), hci_initializing_event_handler(), hci_shutdown_connection(), hci_transport_h5_process_frame(), hci_transport_inactivity_timer_set(), hci_transport_link_clear_queue(), sm_timeout_start(), and sm_timeout_stop().
void btstack_run_loop_set_data_source_fd | ( | btstack_data_source_t * | data_source, |
int | fd | ||
) |
Set data source file descriptor.
data_source | |
fd | file descriptor |
References btstack_data_source::fd.
void btstack_run_loop_set_data_source_handler | ( | btstack_data_source_t * | ds, |
void(*)(btstack_data_source_t *_ds, btstack_data_source_callback_type_t callback_type) | process | ||
) |
Set data source callback.
References btstack_data_source::process.
Referenced by btstack_stdin_setup(), and btstack_uart_block_freertos_init().
void btstack_run_loop_set_timer | ( | btstack_timer_source_t * | a, |
uint32_t | timeout_in_ms | ||
) |
Set timer based on current time in milliseconds.
References btstack_run_loop_assert(), and btstack_run_loop::set_timer.
Referenced by att_server_indicate(), atwilc3000_wait_for_reset_completed(), event_handler(), gap_random_address_update_handler(), gap_random_address_update_start(), gatt_client_timeout_start(), hci_initializing_run(), hci_transport_inactivity_timer_set(), hci_transport_link_set_timer(), heartbeat_handler(), le_counter_setup(), sm_aes128_start(), and sm_timeout_start().
void btstack_run_loop_set_timer_context | ( | btstack_timer_source_t * | ts, |
void * | context | ||
) |
Set context for this timer.
References btstack_timer_source::context.
Referenced by create_connection_for_bd_addr_and_type(), and sm_timeout_start().
void btstack_run_loop_set_timer_handler | ( | btstack_timer_source_t * | ts, |
void(*)(btstack_timer_source_t *_ts) | process | ||
) |
Set callback that will be executed when timer expires.
References btstack_timer_source::process.
Referenced by att_server_indicate(), atwilc3000_wait_for_reset_completed(), create_connection_for_bd_addr_and_type(), gap_random_address_update_start(), gatt_client_timeout_start(), hci_initializing_run(), hci_transport_inactivity_timer_set(), hci_transport_link_set_timer(), sm_aes128_start(), and sm_timeout_start().
void btstack_run_loop_timer_dump | ( | void | ) |
References btstack_run_loop_assert(), and btstack_run_loop::dump_timer.
const btstack_run_loop_t btstack_run_loop_embedded |
|
static |