BLE multi-connection procedure

dsconyers
Posts: 1
Joined: Tue Aug 15, 2017 12:09 pm

Re: BLE multi-connection procedure

Postby dsconyers » Tue Aug 15, 2017 12:18 pm

Weijian-Espressif wrote:hi all, Please update to the latest idf, the attachment is the multi-connection code. we would add the multi-connection demo in the v3.0
Hi Wejian,

I'm looking for multi-connections while ESP32 is running as a peripheral. Our application requires us to send sensor data to 5 smartphones simultaneously, which requires us to be simultaneously connected with 5 BLE centrals while running the ESP32 as a peripheral. Is this an example of multi-connections while ESP32 is running as a central only? Or does it also support multi-connections while ESP32 is running as a peripheral?

Thanks,

Starbuck

cashchew
Posts: 5
Joined: Wed Sep 18, 2019 4:14 pm

Re: BLE multi-connection procedure

Postby cashchew » Wed Dec 09, 2020 3:08 pm

For gattc using single app profile for multiple connections, I tried to modify the existing gattc_multi_connect example which uses multiple profiles for multiple connections. Here I have a few questions:

1) For multiple profiles approach, is there a limit how many profiles can be registered? It seems that each registered profile is associated with a different gattc_if, what are the pro and con for single or multiple profiles when connecting to multiple servers with the same or different types?

2) For single profile (single gattc_if) with multiple connections, is the number of connections limited by the menuconfig settings and there appears 2 settings BTDM_CTRL_BLE_MAX_CONN (default 3) and BT_ACL_CONNECTIONS (default 4), which one should I set?

3) Also, for single profile approach, there are some gattc events that do not have conn_id on its passing param. I.e,
ESP_GATTC_SRVC_CHG_EVT
ESP_GATTC_REG_FOR_NOTIFY_EVT
ESP_GATTC_UNREG_FOR_NOTIFY_EVT
ESP_GATTC_SET_ASSOC_EVT
ESP_GATTC_GET_ADDR_LIST_EVT
So while in that event handling such as ESP_GATTC_REG_FOR_NOTIFY_EVT from "gattc_multi_connect " example, what conn_id should be used when calling esp_ble_gattc_get_attr_count(), esp_ble_gattc_get_descr_by_char_handle(), and esp_ble_gattc_write_char_descr()?

4) By adding gatts (i.e, gattc_gatts_coex example), whenever attempting to connect a client with esp_ble_gattc_open(), all gattc (multiples with multiple profiles used) and gatts interfaces events get dispatched with the event connect, what is the right approach to handle such that gatts should just ignore this connection event?

5) From those idf examples handling gatt callback, it handles events with interface that can be ESP_GATT_IF_NONE. What are those callback events where its gatt interface is ESP_GATT_IF_NONE, and under what scenario?

6) What is the rationale to have Connect and Disconnect events get dispatched to all interfaces (gattc and gatts) when connecting to ble server or get connected from a ble central?

Who is online

Users browsing this forum: cdollar and 107 guests