esp_ble_gatts_open() function
Create an ACL connection when `BT_BLE_42_FEATURES_SUPPORTED` is enabled in the menuconfig
Arguments
gatts_if
GATT Server access interface
remote_bda
Remote device address
is_direct
`True` indicates a direct connection, while `False` indicates a background auto connection. Currently, background auto connection is not supported, so please always set this parameter to True.
Return value
- ESP_OK: Success - ESP_FAIL: Failure
Notes
1. The function always triggers `ESP_GATTS_CONNECT_EVT` and `ESP_GATTS_OPEN_EVT`. 2. When the device acts as GATT Server, besides the above two events, this function triggers `ESP_GATTS_CONNECT_EVT` as well. 3. This function will establish an ACL connection as a Central and a virtual connection as a GATT Server. If the ACL connection already exists, it will create a virtual connection only.
esp_ble_gatts_open() calls 2 functions:
![]()
esp_ble_gatts_open()
esp_ble_gatts_open() reads 6 variables and writes 5 variables:
![]()
esp_ble_gatts_open()