Dynamically registered gattc app makes esp_ble_gattc_open fail

paddy_b
Posts: 11
Joined: Wed Jun 06, 2018 2:00 pm

Dynamically registered gattc app makes esp_ble_gattc_open fail

Postby paddy_b » Tue Jun 04, 2019 7:21 am

I'm trying to make a program I've written support multiple client connections to different servers.
I understand that each connection needs a separate app to be registered.

My process is this:
Perform a scan
Application requests a connection to a certain BDA from the scan results
BLE code creates a struct containing app_id (picked arbitrarily), gattc_if(ESP_GATT_IF_NONE) and the requested BDA
esp_ble_gattc_app_register is called using app_id
gattc_if is set in the resulting ESP_GATTC_REG_EVT callback
esp_ble_gattc_open is then called using the gattc_if value and the BDA

After a few seconds I get:
BT_APPL: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0100

and an ESP_GATTC_OPEN_EVT with status=133

The difference between what I'm trying to do and what the multi-connect example does is that the apps are registered dynamically, rather than pre-registering a few profiles at the start. I also only use a single gatt event handler, rather than distributing events to a separate handler for each profile.

Does anyone have any idea what causes it to fail to open?

Who is online

Users browsing this forum: No registered users and 189 guests