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?