mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +00:00
implement l2cap timeout check for HAVE_TIME_MS
This commit is contained in:
parent
7cdb8a02d8
commit
5f26aadcab
@ -207,6 +207,12 @@ static void hci_connection_timeout_handler(timer_source_t *timer){
|
||||
// connections might be timed out
|
||||
hci_emit_l2cap_check_timeout(connection);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_TIME_MS
|
||||
if (run_loop_get_time_ms() > connection->timestamp + HCI_CONNECTION_TIMEOUT_MS){
|
||||
// connections might be timed out
|
||||
hci_emit_l2cap_check_timeout(connection);
|
||||
}
|
||||
#endif
|
||||
run_loop_set_timer(timer, HCI_CONNECTION_TIMEOUT_MS);
|
||||
run_loop_add_timer(timer);
|
||||
@ -219,6 +225,9 @@ static void hci_connection_timestamp(hci_connection_t *connection){
|
||||
#ifdef HAVE_TICK
|
||||
connection->timestamp = embedded_get_ticks();
|
||||
#endif
|
||||
#ifdef HAVE_TIME_MS
|
||||
connection->timestamp = run_loop_get_time_ms();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -386,9 +386,12 @@ typedef struct {
|
||||
struct timeval timestamp;
|
||||
#endif
|
||||
#ifdef HAVE_TICK
|
||||
uint32_t timestamp; // timeout in system ticks
|
||||
uint32_t timestamp; // timestamp in system ticks
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TIME_MS
|
||||
uint32_t timestamp; // timestamp in ms
|
||||
#endif
|
||||
|
||||
// ACL packet recombination - PRE_BUFFER + ACL Header + ACL payload
|
||||
uint8_t acl_recombination_buffer[HCI_INCOMING_PRE_BUFFER_SIZE + 4 + HCI_ACL_BUFFER_SIZE];
|
||||
uint16_t acl_recombination_pos;
|
||||
|
Loading…
x
Reference in New Issue
Block a user