-
Notifications
You must be signed in to change notification settings - Fork 785
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bugfix/espat-1972' into 'master'
bugfix(ESPAT-1972): Fixed ble connection timeout issue See merge request application/esp-at!1544
- Loading branch information
Showing
8 changed files
with
173 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
module_config/module_esp32-d2wd/patch/modify_bluedroid_conn_timeout.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From 7485572ef7e5b076d90d29f9335dcb726ef3714f Mon Sep 17 00:00:00 2001 | ||
From: xiewenxiang <[email protected]> | ||
Date: Fri, 29 Mar 2024 10:41:25 +0800 | ||
Subject: [PATCH] modify bluedroid conn timeout | ||
|
||
--- | ||
components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | 11 +++++++---- | ||
1 file changed, 7 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
index 4e6c8534ec..fa7a877491 100644 | ||
--- a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
+++ b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
@@ -950,16 +950,19 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb) | ||
L2CAP_TRACE_ERROR("initate direct connection fail, topology limitation"); | ||
return FALSE; | ||
} | ||
- uint32_t link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; | ||
+ | ||
+ extern int32_t bluedroid_conn_wait_time; | ||
+ | ||
+ uint32_t link_timeout = bluedroid_conn_wait_time; | ||
if(GATTC_CONNECT_RETRY_COUNT) { | ||
if(!p_lcb->retry_create_con) { | ||
p_lcb->start_time_s = (esp_system_get_time()/1000); | ||
} | ||
uint32_t current_time = (esp_system_get_time()/1000); | ||
- link_timeout = (L2CAP_BLE_LINK_CONNECT_TOUT*1000 - (current_time - p_lcb->start_time_s))/1000; | ||
+ link_timeout = (bluedroid_conn_wait_time*1000 - (current_time - p_lcb->start_time_s))/1000; | ||
|
||
- if(link_timeout == 0 || link_timeout > L2CAP_BLE_LINK_CONNECT_TOUT) { | ||
- link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; | ||
+ if(link_timeout == 0 || link_timeout > bluedroid_conn_wait_time) { | ||
+ link_timeout = bluedroid_conn_wait_time; | ||
} | ||
} | ||
|
||
-- | ||
2.25.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
module_config/module_esp32-sdio/patch/modify_bluedroid_conn_timeout.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From 7485572ef7e5b076d90d29f9335dcb726ef3714f Mon Sep 17 00:00:00 2001 | ||
From: xiewenxiang <[email protected]> | ||
Date: Fri, 29 Mar 2024 10:41:25 +0800 | ||
Subject: [PATCH] modify bluedroid conn timeout | ||
|
||
--- | ||
components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | 11 +++++++---- | ||
1 file changed, 7 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
index 4e6c8534ec..fa7a877491 100644 | ||
--- a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
+++ b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
@@ -950,16 +950,19 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb) | ||
L2CAP_TRACE_ERROR("initate direct connection fail, topology limitation"); | ||
return FALSE; | ||
} | ||
- uint32_t link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; | ||
+ | ||
+ extern int32_t bluedroid_conn_wait_time; | ||
+ | ||
+ uint32_t link_timeout = bluedroid_conn_wait_time; | ||
if(GATTC_CONNECT_RETRY_COUNT) { | ||
if(!p_lcb->retry_create_con) { | ||
p_lcb->start_time_s = (esp_system_get_time()/1000); | ||
} | ||
uint32_t current_time = (esp_system_get_time()/1000); | ||
- link_timeout = (L2CAP_BLE_LINK_CONNECT_TOUT*1000 - (current_time - p_lcb->start_time_s))/1000; | ||
+ link_timeout = (bluedroid_conn_wait_time*1000 - (current_time - p_lcb->start_time_s))/1000; | ||
|
||
- if(link_timeout == 0 || link_timeout > L2CAP_BLE_LINK_CONNECT_TOUT) { | ||
- link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; | ||
+ if(link_timeout == 0 || link_timeout > bluedroid_conn_wait_time) { | ||
+ link_timeout = bluedroid_conn_wait_time; | ||
} | ||
} | ||
|
||
-- | ||
2.25.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
module_config/module_esp32_default/patch/modify_bluedroid_conn_timeout.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From 7485572ef7e5b076d90d29f9335dcb726ef3714f Mon Sep 17 00:00:00 2001 | ||
From: xiewenxiang <[email protected]> | ||
Date: Fri, 29 Mar 2024 10:41:25 +0800 | ||
Subject: [PATCH] modify bluedroid conn timeout | ||
|
||
--- | ||
components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | 11 +++++++---- | ||
1 file changed, 7 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
index 4e6c8534ec..fa7a877491 100644 | ||
--- a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
+++ b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
@@ -950,16 +950,19 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb) | ||
L2CAP_TRACE_ERROR("initate direct connection fail, topology limitation"); | ||
return FALSE; | ||
} | ||
- uint32_t link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; | ||
+ | ||
+ extern int32_t bluedroid_conn_wait_time; | ||
+ | ||
+ uint32_t link_timeout = bluedroid_conn_wait_time; | ||
if(GATTC_CONNECT_RETRY_COUNT) { | ||
if(!p_lcb->retry_create_con) { | ||
p_lcb->start_time_s = (esp_system_get_time()/1000); | ||
} | ||
uint32_t current_time = (esp_system_get_time()/1000); | ||
- link_timeout = (L2CAP_BLE_LINK_CONNECT_TOUT*1000 - (current_time - p_lcb->start_time_s))/1000; | ||
+ link_timeout = (bluedroid_conn_wait_time*1000 - (current_time - p_lcb->start_time_s))/1000; | ||
|
||
- if(link_timeout == 0 || link_timeout > L2CAP_BLE_LINK_CONNECT_TOUT) { | ||
- link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; | ||
+ if(link_timeout == 0 || link_timeout > bluedroid_conn_wait_time) { | ||
+ link_timeout = bluedroid_conn_wait_time; | ||
} | ||
} | ||
|
||
-- | ||
2.25.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
module_config/module_wrover-32/patch/modify_bluedroid_conn_timeout.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From 7485572ef7e5b076d90d29f9335dcb726ef3714f Mon Sep 17 00:00:00 2001 | ||
From: xiewenxiang <[email protected]> | ||
Date: Fri, 29 Mar 2024 10:41:25 +0800 | ||
Subject: [PATCH] modify bluedroid conn timeout | ||
|
||
--- | ||
components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | 11 +++++++---- | ||
1 file changed, 7 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
index 4e6c8534ec..fa7a877491 100644 | ||
--- a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
+++ b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | ||
@@ -950,16 +950,19 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb) | ||
L2CAP_TRACE_ERROR("initate direct connection fail, topology limitation"); | ||
return FALSE; | ||
} | ||
- uint32_t link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; | ||
+ | ||
+ extern int32_t bluedroid_conn_wait_time; | ||
+ | ||
+ uint32_t link_timeout = bluedroid_conn_wait_time; | ||
if(GATTC_CONNECT_RETRY_COUNT) { | ||
if(!p_lcb->retry_create_con) { | ||
p_lcb->start_time_s = (esp_system_get_time()/1000); | ||
} | ||
uint32_t current_time = (esp_system_get_time()/1000); | ||
- link_timeout = (L2CAP_BLE_LINK_CONNECT_TOUT*1000 - (current_time - p_lcb->start_time_s))/1000; | ||
+ link_timeout = (bluedroid_conn_wait_time*1000 - (current_time - p_lcb->start_time_s))/1000; | ||
|
||
- if(link_timeout == 0 || link_timeout > L2CAP_BLE_LINK_CONNECT_TOUT) { | ||
- link_timeout = L2CAP_BLE_LINK_CONNECT_TOUT; | ||
+ if(link_timeout == 0 || link_timeout > bluedroid_conn_wait_time) { | ||
+ link_timeout = bluedroid_conn_wait_time; | ||
} | ||
} | ||
|
||
|
||
-- | ||
2.25.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters