Closed twomas closed 3 years ago
Probably duplicate to https://github.com/espressif/esp-idf/issues/5149
Hi @twomas ,
The connect.link_role Parameters can be used to determine which end the connection is initiated from.
/**
* @brief ESP_GATTS_CONNECT_EVT
*/
struct gatts_connect_evt_param {
uint16_t conn_id; /*!< Connection id */
uint8_t link_role; /*!< Link role : master role = 0 ; slave role = 1*/
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
esp_gatt_conn_params_t conn_params; /*!< current Connection parameters */
} connect; /*!< Gatt server callback param of ESP_GATTS_CONNECT_EVT */ /*!< Gatt server callback param of ESP_GATTS_CONNECT_EVT */
/**
* @brief ESP_GATTC_CONNECT_EVT
*/
struct gattc_connect_evt_param {
uint16_t conn_id; /*!< Connection id */
uint8_t link_role; /*!< Link role : master role = 0 ; slave role = 1*/
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
esp_gatt_conn_params_t conn_params; /*!< current connection parameters */
} connect; /*!< Gatt client callback param of ESP_GATTC_CONNECT_EVT */
Using link_role
Environment
git describe --tags
to find it): v4.4-dev-3235-g3e370c4296xtensa-esp32-elf-gcc --version
to find it): xtensa-esp32s3-elf-gcc.exe (crosstool-NG esp-2021r1) 8.4.0Problem Description
Using example gattc_gatts_coex Log from esp32s3 I (22284) GATTC_GATTS_COEX: ESP_GATTS_CONNECT_EVT, conn_id 0, remote 7f:a6:cc:23:bf:dc
I (22284) GATTC_GATTS_COEX: CONNECT_EVT, conn_id 0, remote 7f:a6:cc:23:bf:dc
I (22294) GATTC_GATTS_COEX: ESP_GATTC_CONNECT_EVT conn_id 0, if 5
Did not expect callbacks from local client when connecting to local server from remote device.
Expected Behavior
Only this event ESP_GATTS_CONNECT_EVT
Actual Behavior
Duplicate events ESP_GATTS_CONNECT_EVT and ESP_GATTC_CONNECT_EVT
Steps to reproduce
Connect to ESP_GATTS_DEMO ( gattc_gatts_coex) via nRF Connect from mobile phone