add hci_disable_l2cap_timeout_check() for testing

This commit is contained in:
matthias.ringwald@gmail.com 2014-01-27 19:24:12 +00:00
parent a0ae0a6911
commit 66fb95602d
2 changed files with 11 additions and 0 deletions

View File

@ -78,6 +78,10 @@ static hci_stack_t hci_stack_static;
#endif
static hci_stack_t * hci_stack = NULL;
// test helper
static uint8_t disable_l2cap_timeouts = 0;
/**
* get connection for a given handle
*
@ -909,6 +913,7 @@ void hci_init(hci_transport_t *transport, void *config, bt_control_t *control, r
#else
hci_stack = &hci_stack_static;
#endif
memset(hci_stack, 0, sizeof(hci_stack_t));
// reference to use transport layer implementation
hci_stack->hci_transport = transport;
@ -980,6 +985,9 @@ void hci_set_class_of_device(uint32_t class_of_device){
hci_stack->class_of_device = class_of_device;
}
void hci_disable_l2cap_timeout_check(){
disable_l2cap_timeouts = 1;
}
// State-Module-Driver overview
// state module low-level
// HCI_STATE_OFF off close
@ -1763,6 +1771,7 @@ void hci_emit_disconnection_complete(uint16_t handle, uint8_t reason){
}
void hci_emit_l2cap_check_timeout(hci_connection_t *conn){
if (disable_l2cap_timeouts) return;
log_info("L2CAP_EVENT_TIMEOUT_CHECK");
uint8_t event[4];
event[0] = L2CAP_EVENT_TIMEOUT_CHECK;

View File

@ -414,6 +414,8 @@ int hci_remote_ssp_supported(hci_con_handle_t con_handle);
// query if both sides support SSP
int hci_ssp_supported_on_both_sides(hci_con_handle_t handle);
// disable automatic l2cap disconnect for testing
void hci_disable_l2cap_timeout_check();
// disconnect because of security block
void hci_disconnect_security_block(hci_con_handle_t con_handle);