auto-pts: remove timer before adding them again

This commit is contained in:
Matthias Ringwald 2019-12-16 23:28:37 +01:00
parent 0ec8b67496
commit a92b1593b3

View File

@ -755,6 +755,7 @@ static void btp_gap_handler(uint8_t opcode, uint8_t controller_index, uint16_t l
}
if (flags & BTP_GAP_DISCOVERY_FLAG_LIMITED){
// set timer
btstack_run_loop_remove_timer(&gap_limited_discovery_timer);
btstack_run_loop_set_timer_handler(&gap_limited_discovery_timer, gap_limited_discovery_timeout_handler);
btstack_run_loop_set_timer(&gap_limited_discovery_timer, LIM_DISC_SCAN_MIN_MS);
btstack_run_loop_add_timer(&gap_limited_discovery_timer);
@ -794,6 +795,7 @@ static void btp_gap_handler(uint8_t opcode, uint8_t controller_index, uint16_t l
// schedule response
gap_send_connect_response = true;
#if 1
btstack_run_loop_remove_timer(&gap_connection_timer);
btstack_run_loop_set_timer_handler(&gap_connection_timer, &gap_connect_timeout_handler);
btstack_run_loop_set_timer(&gap_connection_timer, GAP_CONNECT_TIMEOUT_MS);
btstack_run_loop_add_timer(&gap_connection_timer);