Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
863d6ee
feat(i2s): support to lazy constitute full-duplex mode
L-KAYA May 26, 2025
df997e8
fix(examples): fixed bridge example test endnode to host send
kostaond Oct 27, 2025
b286e36
fix(i2s): fixed invalid offset in the big gap writing scenario
L-KAYA Oct 21, 2025
e2699f8
test(freertos): Added miscellaneous stability fixes to unit tests
sudeep-mohanty Nov 3, 2025
4d928f2
fix(bt/blurdoird): fixed an OOB write in bta_dm_sdp_result
BetterJincheng Oct 28, 2025
8070e0f
fix(802.15.4): fix line save in 154 debug
Nov 10, 2025
23b351a
fix(examples): Fix typos in NimBLE example comments
rabuu Nov 4, 2025
1bc5b34
fix(bt/bluedroid): update the COD before enabling inquiry scan
BetterJincheng Aug 25, 2025
8b83620
Merge branch 'contrib/github_pr_17824_v5.3' into 'release/v5.3'
rahult-github Nov 11, 2025
690dd32
feat(mbedtls): update to version 3.6.5
Ashish285 Oct 16, 2025
36c63ef
Merge branch 'test/freertos_flaky_tests_stabilization_v5.3' into 'rel…
ESP-Marius Nov 11, 2025
9778f67
Merge branch 'fix/fix_save_line_in_debug_for_154_v5.3' into 'release/…
chshu Nov 11, 2025
a0358ca
change(ble): [AUTO_MR] Update lib_esp32c2 to 27b6e1dc
Nov 7, 2025
0a38d42
change(ble): [AUTO_MR] updated rom linker script for ESP32-C2
Nov 5, 2025
6088831
change(ble): [AUTO_MR] Update lib_esp32h2 to b6027aeb
Nov 7, 2025
4a59cf2
change(ble): [AUTO_MR] Update lib_esp32c6 to b6027aeb
Nov 7, 2025
26764aa
feat: rename ble sleep related apt on ESP32-C6
zhaoweiliang2021 Nov 7, 2025
c099a89
feat: rename ble sleep related apt on ESP32-H2
zhaoweiliang2021 Nov 7, 2025
3f54ffe
feat(ble): add peripheral fast rx data in latency config on ESP32-C6
zhaoweiliang2021 Nov 7, 2025
4bf4327
Merge branch 'bugfix/cod_chg_by_scan_ena_v5.3' into 'release/v5.3'
wmy-espressif Nov 12, 2025
32f8355
fix(ble): increase default ble log stack size for xtensa chips
Nov 12, 2025
7348c65
Merge branch 'bugfix/oob_in_bta_dm_sdp_result_v5.3' into 'release/v5.3'
wmy-espressif Nov 13, 2025
245f5f7
Merge branch 'fix/increase_ble_log_task_stack_size_for_xtensa_chips_v…
Isl2017 Nov 13, 2025
1b9419d
fix(bt/bluedroid): Fixed HID memory leak
boblane1 Oct 23, 2025
aa76c11
fix(bt/controller): Fixed some controller bugs
BetterJincheng Nov 10, 2025
e346b83
feat(ble/bluedroid): Added BLE debug LOG for bluedroid
esp-zhp Aug 28, 2025
76e5b51
Merge branch 'bugfix/fix_hid_memory_leak_v5.3' into 'release/v5.3'
wmy-espressif Nov 14, 2025
4eb4a52
Merge branch 'change/ble_update_lib_20251106_v5.3' into 'release/v5.3'
Isl2017 Nov 14, 2025
0679495
Merge branch 'bugfix/bluetooth_chan_map_error_v5.3' into 'release/v5.3'
wmy-espressif Nov 14, 2025
7f18945
fix(gpio): fix USB DP pin unusable after CPU reset for S3/C3
songruo Sep 2, 2025
9a38d62
Merge branch 'feat/update_mbedtls_3.6.5_v5.3' into 'release/v5.3'
mahavirj Nov 17, 2025
0adf5ff
feat(phy): ESP32-C5 ECO2/ECO3 coex and ESP32-C6 track reset
Nov 17, 2025
bfc3815
test(ulp): added larger delay in ULP FSM I_WR_REG instruction test
ESP-Marius Nov 17, 2025
f5e6c22
test(pcnt): fix pcnt example pytest
Kainarx Nov 4, 2025
bd6bd6b
Merge branch 'ci/ulp_fsm_i_wr_reg_v5.3' into 'release/v5.3'
ESP-Marius Nov 18, 2025
0004b04
Merge branch 'feat/phy_lib_update_c5eco3_coex_v5.3' into 'release/v5.3'
Nov 18, 2025
6ec1350
Merge branch 'opt/opt_ble_log_v5.3' into 'release/v5.3'
Isl2017 Nov 18, 2025
ccb043b
fix(openthread): resolve deadlock issues due to switching_lock
tanyanquan Nov 18, 2025
1e1f440
Merge branch 'fix/pcnt_example_pytest_v5.3' into 'release/v5.3'
suda-morris Nov 18, 2025
6cf94bc
Merge branch 'feature/i2s_support_merge_simplex_to_duplex_v5.3' into …
suda-morris Nov 18, 2025
00e6f19
Merge branch 'bugfix/usb_dp_pin_unusable_after_cpu_reset_v5.3' into '…
suda-morris Nov 18, 2025
b935de3
fix(esp_lcd): Issue where M5Stack CoreS3 uses GPIO 35 for MISO and LC…
jboynes Nov 12, 2025
0e684ec
Merge branch 'fix/fix_some_deadlock_issue_v5.3' into 'release/v5.3'
chshu Nov 18, 2025
0c663f5
Merge branch 'contrib/github_pr_17858_v5.3' into 'release/v5.3'
suda-morris Nov 19, 2025
319e195
Merge branch 'bugfix/fixed_i2s_write_invalid_offset_issue_v5.3' into …
suda-morris Nov 19, 2025
cdd8f31
Merge branch 'fix/bridge_example_v5.3' into 'release/v5.3'
euripedesrocha Nov 20, 2025
bb945d9
feat(bt): Adds an SPP API parameter to indicate whether to create SPP…
xiongweichao Nov 18, 2025
e7ee24c
fix(ble/bluedroid): Fixed BLE incorrect device record count issue
esp-zhp Nov 21, 2025
18c3237
fix(bt/examples): Fixed test_bt_l2cap not finding ESP_SDP_CREATE_RECO…
Finney-esp Nov 17, 2025
cb9dc0d
fix(ble/bluedroid): Fixed missing BLE connect and disconnect events
esp-zhp Nov 21, 2025
8bcb91e
ci: pytest-ignore skip using dut id
Nov 24, 2025
5f3d8ac
Merge branch 'feat/add_param_indicate_create_spp_records_v5.3' into '…
wmy-espressif Nov 24, 2025
235c50f
Merge branch 'bugfix/bt_idf_ci_v5.3' into 'release/v5.3'
wmy-espressif Nov 24, 2025
18e0674
fix(bt): Update esp32 libbtdm_app.a (15a18b1a)
esp-zhp Nov 25, 2025
6485614
fix(openthread): remove the duplicate macro definition
gytxxsy Nov 20, 2025
890c7d9
feat(openthread): Use PSRAM by default for OpenThread message buffers…
gytxxsy Nov 19, 2025
ae1ca0e
Merge branch 'ci/known-failure-dut-id-v5.3' into 'release/v5.3'
hfudev Nov 25, 2025
4bf1bf6
Merge branch 'fix/remove_the_duplicate_macro_definition_v5.3' into 'r…
chshu Nov 26, 2025
f3586ea
Merge branch 'feature/change_ot_psram_default_config_v5.3' into 'rele…
chshu Nov 26, 2025
d2e1fb1
feat(openthread): optimize fail cases in CI test
Nov 21, 2025
3be4c8e
feat(ble/nimble): support runtime allocation for mempool
esp-cjh Oct 28, 2025
17f375b
fix(nimble): Add a check for psync before processing
rahult-github Oct 6, 2025
5869332
Merge branch 'bugfix/update_thread_ci_testcases_v5.3' into 'release/v…
chshu Nov 27, 2025
6a14861
Merge branch 'bugfix/check_psync_status_v5.3' into 'release/v5.3'
rahult-github Nov 27, 2025
c3b0115
ci(parlio): fixed incorrect condition in rx test case
L-KAYA Oct 28, 2025
cbefff5
Merge branch 'bugfix/fix_ble_scan_enable_timeout_v5.3' into 'release/…
Isl2017 Nov 28, 2025
0b8ca3d
Merge branch 'bugfix/bug_ble_max_device_record_v5.3' into 'release/v5.3'
Isl2017 Nov 28, 2025
6949294
Merge branch 'ci/fixed_parlio_rx_test_case_incorrect_condition_v5.3' …
suda-morris Nov 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions components/bt/common/ble_log/Kconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ config BLE_LOG_ENABLED
if BLE_LOG_ENABLED
config BLE_LOG_TASK_STACK_SIZE
int "Stack size for BLE Log Task"
default 1024 if IDF_TARGET_ARCH_RISCV
default 2048 if IDF_TARGET_ARCH_XTENSA
default 1024
help
Stack size for BLE Log Task
Expand Down
7 changes: 7 additions & 0 deletions components/bt/common/ble_log/ble_log_spi_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@
#define SPI_OUT_LOG_STR_BUF_SIZE (100)
#define SPI_OUT_MALLOC(size) heap_caps_malloc(size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)
#define SPI_OUT_TASK_PRIORITY (ESP_TASK_PRIO_MAX - 1)

#if CONFIG_IDF_TARGET_ARCH_RISCV
#define SPI_OUT_TASK_STACK_SIZE (1024)
#elif CONFIG_IDF_TARGET_ARCH_XTENSA
#define SPI_OUT_TASK_STACK_SIZE (2048)
#else
static_assert(false, "BLE Log SPI Out: Unsupported target architecture");
#endif /* CONFIG_IDF_TARGET_ARCH_RISCV */

#if SPI_OUT_TS_SYNC_ENABLED
#define SPI_OUT_TS_SYNC_TIMEOUT_MS (1000)
Expand Down
2 changes: 1 addition & 1 deletion components/bt/common/btc/core/btc_alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void btc_alarm_handler(btc_msg_t *msg)
{
btc_alarm_args_t *arg = (btc_alarm_args_t *)msg->arg;

BTC_TRACE_DEBUG("%s act %d\n", __FUNCTION__, msg->act);
BTC_TRACE_DEBUG("%s act %d", __func__, msg->act);

if (arg->cb) {
arg->cb(arg->cb_data);
Expand Down
1 change: 1 addition & 0 deletions components/bt/common/include/bt_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ typedef uint64_t UINT64;
typedef bool BOOLEAN;
/* Maximum UUID size - 16 bytes, and structure to hold any type of UUID. */
#define MAX_UUID_SIZE 16
#define MAX_UUID_NUM 32

typedef struct {
#define LEN_UUID_16 2
Expand Down
5 changes: 1 addition & 4 deletions components/bt/common/osi/allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,5 @@ void *osi_calloc_func(size_t size)

void osi_free_func(void *ptr)
{
#if HEAP_MEMORY_DEBUG
osi_mem_dbg_clean(ptr, __func__, __LINE__);
#endif
free(ptr);
osi_free(ptr);
}
8 changes: 8 additions & 0 deletions components/bt/controller/esp32c6/Kconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -977,3 +977,11 @@ menu "Scheduling Priority Level Config"
default 2 if BT_LE_SYNC_SCHED_PRIO_HIGH_LEVEL
default 1
endmenu

config BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN
bool "Enable Peripheral fast PDU reception during latency"
default n
help
When this option is enabled, the Controller continues receiving PDUs
In the next connection event instead of entering latency
After a data packet is received.
6 changes: 3 additions & 3 deletions components/bt/controller/esp32c6/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ extern void esp_unregister_npl_funcs (void);
extern void npl_freertos_mempool_deinit(void);
extern uint32_t r_os_cputime_get32(void);
extern uint32_t r_os_cputime_ticks_to_usecs(uint32_t ticks);
extern void r_ble_lll_rfmgmt_set_sleep_cb(void *s_cb, void *w_cb, void *s_arg,
extern void r_ble_lll_sleep_set_sleep_cb(void *s_cb, void *w_cb, void *s_arg,
void *w_arg, uint32_t us_to_enabled);
extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
Expand Down Expand Up @@ -851,10 +851,10 @@ esp_err_t controller_sleep_init(void)
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "BLE modem sleep is enabled");
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
r_ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
r_ble_lll_sleep_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
BLE_RTC_DELAY_US_LIGHT_SLEEP);
#else
r_ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
r_ble_lll_sleep_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
BLE_RTC_DELAY_US_MODEM_SLEEP);
#endif /* FREERTOS_USE_TICKLESS_IDLE */
#endif // CONFIG_BT_LE_SLEEP_ENABLE
Expand Down
6 changes: 6 additions & 0 deletions components/bt/controller/esp32c6/esp_bt_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ extern "C" {
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
#endif

#if defined(CONFIG_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN)
#define DEFAULT_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN (CONFIG_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN)
#else
#define DEFAULT_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN (0)
#endif

#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#else
Expand Down
8 changes: 8 additions & 0 deletions components/bt/controller/esp32h2/Kconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -981,3 +981,11 @@ menu "Scheduling Priority Level Config"
default 2 if BT_LE_SYNC_SCHED_PRIO_HIGH_LEVEL
default 1
endmenu

config BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN
bool "Enable Peripheral fast PDU reception during latency"
default n
help
When this option is enabled, the Controller continues receiving PDUs
In the next connection event instead of entering latency
After a data packet is received.
6 changes: 3 additions & 3 deletions components/bt/controller/esp32h2/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ extern void esp_unregister_npl_funcs (void);
extern void npl_freertos_mempool_deinit(void);
extern uint32_t r_os_cputime_get32(void);
extern uint32_t r_os_cputime_ticks_to_usecs(uint32_t ticks);
extern void r_ble_lll_rfmgmt_set_sleep_cb(void *s_cb, void *w_cb, void *s_arg,
extern void r_ble_lll_sleep_set_sleep_cb(void *s_cb, void *w_cb, void *s_arg,
void *w_arg, uint32_t us_to_enabled);
extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
Expand Down Expand Up @@ -816,10 +816,10 @@ esp_err_t controller_sleep_init(void)
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "BLE modem sleep is enabled");
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
r_ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
r_ble_lll_sleep_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
BLE_RTC_DELAY_US_LIGHT_SLEEP);
#else
r_ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
r_ble_lll_sleep_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
BLE_RTC_DELAY_US_MODEM_SLEEP);
#endif /* FREERTOS_USE_TICKLESS_IDLE */
#endif // CONFIG_BT_LE_SLEEP_ENABLE
Expand Down
6 changes: 6 additions & 0 deletions components/bt/controller/esp32h2/esp_bt_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ extern "C" {
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
#endif

#if defined(CONFIG_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN)
#define DEFAULT_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN (CONFIG_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN)
#else
#define DEFAULT_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN (0)
#endif

#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#else
Expand Down
2 changes: 1 addition & 1 deletion components/bt/controller/lib_esp32
2 changes: 1 addition & 1 deletion components/bt/controller/lib_esp32h2/esp32h2-bt-lib
2 changes: 1 addition & 1 deletion components/bt/host/bluedroid/api/esp_hidd_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ esp_err_t esp_bt_hid_device_send_report(esp_hidd_report_type_t type, uint8_t id,
args.send_report.data = data;

bt_status_t stat = btc_transfer_context(&msg, &args, sizeof(btc_hidd_args_t),
btc_hd_arg_deep_copy, btc_hd_cb_arg_deep_free);
btc_hd_arg_deep_copy, btc_hd_call_arg_deep_free);
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}

Expand Down
6 changes: 3 additions & 3 deletions components/bt/host/bluedroid/api/esp_hidh_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ esp_err_t esp_bt_hid_host_set_info(esp_bd_addr_t bd_addr, esp_hidh_hid_info_t *h
arg.set_info.hid_info = hid_info;

bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_hidh_args_t),
btc_hh_arg_deep_copy, btc_hh_cb_arg_deep_free);
btc_hh_arg_deep_copy, btc_hh_call_arg_deep_free);
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}

Expand Down Expand Up @@ -224,7 +224,7 @@ esp_err_t esp_bt_hid_host_set_report(esp_bd_addr_t bd_addr, esp_hidh_report_type
arg.set_report.report = report;

bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_hidh_args_t),
btc_hh_arg_deep_copy, btc_hh_cb_arg_deep_free);
btc_hh_arg_deep_copy, btc_hh_call_arg_deep_free);
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}

Expand All @@ -243,7 +243,7 @@ esp_err_t esp_bt_hid_host_send_data(esp_bd_addr_t bd_addr, uint8_t *data, size_t
arg.send_data.data = data;

bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_hidh_args_t),
btc_hh_arg_deep_copy, btc_hh_cb_arg_deep_free);
btc_hh_arg_deep_copy, btc_hh_call_arg_deep_free);
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}

Expand Down
35 changes: 24 additions & 11 deletions components/bt/host/bluedroid/api/esp_spp_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,34 @@ esp_err_t esp_spp_disconnect(uint32_t handle)

esp_err_t esp_spp_start_srv(esp_spp_sec_t sec_mask,
esp_spp_role_t role, uint8_t local_scn, const char *name)
{
esp_spp_start_srv_cfg_t cfg = {0};

cfg.local_scn = local_scn;
cfg.sec_mask = sec_mask;
cfg.role = role;
cfg.create_spp_record = true;
cfg.name = name;
return esp_spp_start_srv_with_cfg(&cfg);
}

esp_err_t esp_spp_start_srv_with_cfg(const esp_spp_start_srv_cfg_t *cfg)
{
btc_msg_t msg;
btc_spp_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);

if (name == NULL || strlen(name) > ESP_SPP_SERVER_NAME_MAX) {
if (cfg == NULL || cfg->name == NULL || strlen(cfg->name) > ESP_SPP_SERVER_NAME_MAX) {
LOG_ERROR("Invalid server name!\n");
return ESP_ERR_INVALID_ARG;
}

if (sec_mask != ESP_SPP_SEC_NONE &&
sec_mask != ESP_SPP_SEC_AUTHENTICATE &&
sec_mask != (ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT) &&
sec_mask != ESP_SPP_SEC_IN_16_DIGITS &&
sec_mask != (ESP_SPP_SEC_IN_16_DIGITS | ESP_SPP_SEC_AUTHENTICATE) &&
sec_mask != (ESP_SPP_SEC_IN_16_DIGITS | ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT)) {
if (cfg->sec_mask != ESP_SPP_SEC_NONE &&
cfg->sec_mask != ESP_SPP_SEC_AUTHENTICATE &&
cfg->sec_mask != (ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT) &&
cfg->sec_mask != ESP_SPP_SEC_IN_16_DIGITS &&
cfg->sec_mask != (ESP_SPP_SEC_IN_16_DIGITS | ESP_SPP_SEC_AUTHENTICATE) &&
cfg->sec_mask != (ESP_SPP_SEC_IN_16_DIGITS | ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT)) {
LOG_WARN("Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHENTICATE,"
"(ESP_SPP_SEC_AUTHENTICATE | ESP_SPP_SEC_ENCRYPT),"
"ESP_SPP_SEC_IN_16_DIGITS, (ESP_SPP_SEC_IN_16_DIGITS | ESP_SPP_SEC_AUTHENTICATE), or"
Expand All @@ -171,11 +183,12 @@ esp_err_t esp_spp_start_srv(esp_spp_sec_t sec_mask,
msg.pid = BTC_PID_SPP;
msg.act = BTC_SPP_ACT_START_SRV;

arg.start_srv.sec_mask = sec_mask;
arg.start_srv.role = role;
arg.start_srv.local_scn = local_scn;
arg.start_srv.sec_mask = cfg->sec_mask;
arg.start_srv.role = cfg->role;
arg.start_srv.local_scn = cfg->local_scn;
arg.start_srv.create_spp_record = cfg->create_spp_record;
arg.start_srv.max_session = ESP_SPP_MAX_SESSION;
strcpy(arg.start_srv.name, name);
strcpy(arg.start_srv.name, cfg->name);

return (btc_transfer_context(&msg, &arg, sizeof(btc_spp_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
Expand Down
26 changes: 25 additions & 1 deletion components/bt/host/bluedroid/api/include/api/esp_spp_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,25 @@ typedef enum {
} esp_spp_mode_t;

/**
* @brief SPP configuration parameters
* @brief SPP initialization configuration parameters.
*/
typedef struct {
esp_spp_mode_t mode; /*!< Choose the mode of SPP, ESP_SPP_MODE_CB or ESP_SPP_MODE_VFS. */
bool enable_l2cap_ertm; /*!< Enable/disable Logical Link Control and Adaptation Layer Protocol enhanced retransmission mode. */
uint16_t tx_buffer_size; /*!< Tx buffer size for a new SPP channel. A smaller setting can save memory, but may incur a decrease in throughput. Only for ESP_SPP_MODE_VFS mode. */
} esp_spp_cfg_t;

/**
* @brief SPP start server configuration parameters.
*/
typedef struct {
uint8_t local_scn; /*!< The specific channel you want to get. If channel is 0, means get any channel. */
bool create_spp_record; /*!< Specifies whether to create the SPP record */
esp_spp_sec_t sec_mask; /*!< Security Setting Mask. Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHORIZE or ESP_SPP_SEC_AUTHENTICATE only */
esp_spp_role_t role; /*!< Master or slave. */
const char *name; /*!< Server's name. */
} esp_spp_start_srv_cfg_t;

/**
* @brief SPP callback function events
*/
Expand Down Expand Up @@ -368,6 +379,19 @@ esp_err_t esp_spp_disconnect(uint32_t handle);
*/
esp_err_t esp_spp_start_srv(esp_spp_sec_t sec_mask, esp_spp_role_t role, uint8_t local_scn, const char *name);

/**
* @brief This function is similar to `esp_spp_start_srv`.
* The only difference is that it adds a parameter to specify whether to create the SPP record.
* @note If the SPP record is not created, it is suggested to use it together with the SDP API.
*
* @param[in] cfg: Configuration parameters for starting the server.
*
* @return
* - ESP_OK: success
* - other: failed
*/
esp_err_t esp_spp_start_srv_with_cfg(const esp_spp_start_srv_cfg_t *cfg);

/**
* @brief This function stops all SPP servers.
* The operation will close all active SPP connection first, then the callback function will be called
Expand Down
19 changes: 14 additions & 5 deletions components/bt/host/bluedroid/bta/dm/bta_dm_act.c
Original file line number Diff line number Diff line change
Expand Up @@ -2056,7 +2056,7 @@ void bta_dm_sdp_result (tBTA_DM_MSG *p_data)
#endif

UINT32 num_uuids = 0;
UINT8 uuid_list[32][MAX_UUID_SIZE]; // assuming a max of 32 services
UINT8 uuid_list[MAX_UUID_NUM][MAX_UUID_SIZE]; // assuming a max of MAX_UUID_NUM services

if ((p_data->sdp_event.sdp_result == SDP_SUCCESS)
|| (p_data->sdp_event.sdp_result == SDP_NO_RECS_MATCH)
Expand Down Expand Up @@ -2119,8 +2119,12 @@ void bta_dm_sdp_result (tBTA_DM_MSG *p_data)
(tBTA_SERVICE_MASK)(BTA_SERVICE_ID_TO_SERVICE_MASK(bta_dm_search_cb.service_index - 1));
tmp_svc = bta_service_id_to_uuid_lkup_tbl[bta_dm_search_cb.service_index - 1];
/* Add to the list of UUIDs */
sdpu_uuid16_to_uuid128(tmp_svc, uuid_list[num_uuids]);
num_uuids++;
if (num_uuids < MAX_UUID_NUM) {
sdpu_uuid16_to_uuid128(tmp_svc, uuid_list[num_uuids]);
num_uuids++;
} else {
APPL_TRACE_WARNING("only process the first %d records\n", MAX_UUID_NUM);
}
}
}
}
Expand Down Expand Up @@ -2154,8 +2158,13 @@ void bta_dm_sdp_result (tBTA_DM_MSG *p_data)
p_sdp_rec = SDP_FindServiceInDb_128bit(bta_dm_search_cb.p_sdp_db, p_sdp_rec);
if (p_sdp_rec) {
if (SDP_FindServiceUUIDInRec_128bit(p_sdp_rec, &temp_uuid)) {
memcpy(uuid_list[num_uuids], temp_uuid.uu.uuid128, MAX_UUID_SIZE);
num_uuids++;
if (num_uuids < MAX_UUID_NUM) {
memcpy(uuid_list[num_uuids], temp_uuid.uu.uuid128, MAX_UUID_SIZE);
num_uuids++;
} else {
APPL_TRACE_WARNING("only process the first %d records\n", MAX_UUID_NUM);
break;
}
}
}
} while (p_sdp_rec);
Expand Down
Loading
Loading