Page 1 of 1

esp32s3做主机,只能实现6个从机,注册时报错

Posted: Sun Apr 06, 2025 11:48 am
by Tristan_C
在注册第6个设备调用接口 esp_ble_gattc_app_register


static void per_ble_gattc_app_register(void)
{
uint8_t index = 0;
esp_err_t ret = ESP_OK;

for(index = 0; index < APP_MAX_CONN_NUM; index++)
{
if((0 != memcmp(ble_addr_invalid_FF, per_conn_info[index].gattc_profile_inst.remote_bda, ESP_BD_ADDR_LEN)) &&
(0 != memcmp(ble_addr_invalid_00, per_conn_info[index].gattc_profile_inst.remote_bda, ESP_BD_ADDR_LEN)))
{
ret = esp_ble_gattc_app_register(per_conn_info[index].gattc_profile_inst.app_id);
if (ret){
ESP_LOGE(GATTC_TAG, "gattc app register error, error code = %x, app_id = %x", ret, per_conn_info[index].gattc_profile_inst.app_id);
return;
}
else
{
ESP_LOGI(GATTC_TAG, "gattc app register success, app_id = %x", per_conn_info[index].gattc_profile_inst.app_id);
}
}
}
}

之后报了错误:BT_APPL: Register with GATT stack failed

请问可能是什么原因造成的?

I (4432) BLE_MASTER: gattc app register success, app_id = 0
I (4439) BLE_MASTER: EVT 0, gattc if 4, app_id 1
I (4444) BLE_MASTER: Reg app success, app_id 0001, status 0
I (4450) BLE_MASTER: gattc_profile_event_handler, gattc_if:4
I (4456) BLE_MASTER: REG_EVT
I (4460) BLE_MASTER: gattc app register success, app_id = 1
I (4467) BLE_MASTER: EVT 0, gattc if 5, app_id 2
I (4472) BLE_MASTER: Reg app success, app_id 0002, status 0
I (4478) BLE_MASTER: gattc_profile_event_handler, gattc_if:5
I (4484) BLE_MASTER: REG_EVT
I (4488) BLE_MASTER: gattc app register success, app_id = 2
I (4494) BLE_MASTER: EVT 0, gattc if 6, app_id 3
I (4499) BLE_MASTER: Reg app success, app_id 0003, status 0
I (4505) BLE_MASTER: gattc_profile_event_handler, gattc_if:6
I (4512) BLE_MASTER: REG_EVT
I (4515) BLE_MASTER: gattc app register success, app_id = 3
I (4522) BLE_MASTER: EVT 0, gattc if 7, app_id 4
I (4527) BLE_MASTER: Reg app success, app_id 0004, status 0
I (4533) BLE_MASTER: gattc_profile_event_handler, gattc_if:7
I (4539) BLE_MASTER: REG_EVT
I (4543) BLE_MASTER: gattc app register success, app_id = 4
I (4550) BLE_MASTER: EVT 0, gattc if 8, app_id 5
I (4555) BLE_MASTER: Reg app success, app_id 0005, status 0
I (4561) BLE_MASTER: gattc_profile_event_handler, gattc_if:8
I (4567) BLE_MASTER: REG_EVT
I (4571) BLE_MASTER: gattc app register success, app_id = 5
E (4577) BT_APPL: Register with GATT stack failed.

E (4583) BT_APPL: Register with GATT stack failed.

E (4588) BT_APPL: Register with GATT stack failed.

I (4594) BLE_MASTER: EVT 0, gattc if 0, app_id 6
I (4599) BLE_MASTER: Reg app failed, app_id 0006, status 133
I (4606) BLE_MASTER: gattc app register success, app_id = 6
I (4612) BLE_MASTER: BLE central init done
I (4618) BLE_MASTER: Scan start success