mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
bluedroid: add params in GATT connect event
This commit is contained in:
parent
78437f48ae
commit
a13b89a043
@ -204,6 +204,8 @@ typedef union {
|
|||||||
uint8_t link_role; /*!< Link role : master role = 0 ; slave role = 1*/
|
uint8_t link_role; /*!< Link role : master role = 0 ; slave role = 1*/
|
||||||
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
|
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
|
||||||
esp_gatt_conn_params_t conn_params; /*!< current connection parameters */
|
esp_gatt_conn_params_t conn_params; /*!< current connection parameters */
|
||||||
|
esp_ble_addr_type_t ble_addr_type; /*!< Remote BLE device address type */
|
||||||
|
uint16_t conn_handle; /*!< HCI connection handle */
|
||||||
} connect; /*!< Gatt client callback param of ESP_GATTC_CONNECT_EVT */
|
} connect; /*!< Gatt client callback param of ESP_GATTC_CONNECT_EVT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -191,6 +191,8 @@ typedef union {
|
|||||||
uint8_t link_role; /*!< Link role : master role = 0 ; slave role = 1*/
|
uint8_t link_role; /*!< Link role : master role = 0 ; slave role = 1*/
|
||||||
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
|
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
|
||||||
esp_gatt_conn_params_t conn_params; /*!< current Connection parameters */
|
esp_gatt_conn_params_t conn_params; /*!< current Connection parameters */
|
||||||
|
esp_ble_addr_type_t ble_addr_type; /*!< Remote BLE device address type */
|
||||||
|
uint16_t conn_handle; /*!< HCI connection handle */
|
||||||
} connect; /*!< Gatt server callback param of ESP_GATTS_CONNECT_EVT */
|
} connect; /*!< Gatt server callback param of ESP_GATTS_CONNECT_EVT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -742,7 +742,8 @@ void bta_gattc_conncback(tBTA_GATTC_RCB *p_rcb, tBTA_GATTC_DATA *p_data)
|
|||||||
if (p_rcb) {
|
if (p_rcb) {
|
||||||
bta_gattc_send_connect_cback(p_rcb,
|
bta_gattc_send_connect_cback(p_rcb,
|
||||||
p_data->int_conn.remote_bda,
|
p_data->int_conn.remote_bda,
|
||||||
p_data->int_conn.hdr.layer_specific, p_data->int_conn.conn_params, p_data->int_conn.role);
|
p_data->int_conn.hdr.layer_specific, p_data->int_conn.conn_params, p_data->int_conn.role,
|
||||||
|
p_data->int_conn.ble_addr_type, p_data->int_conn.conn_handle);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1688,6 +1689,11 @@ static void bta_gattc_conn_cback(tGATT_IF gattc_if, BD_ADDR bda, UINT16 conn_id,
|
|||||||
p_buf->int_conn.conn_params.interval = p_lcb->current_used_conn_interval;
|
p_buf->int_conn.conn_params.interval = p_lcb->current_used_conn_interval;
|
||||||
p_buf->int_conn.conn_params.latency = p_lcb->current_used_conn_latency;
|
p_buf->int_conn.conn_params.latency = p_lcb->current_used_conn_latency;
|
||||||
p_buf->int_conn.conn_params.timeout = p_lcb->current_used_conn_timeout;
|
p_buf->int_conn.conn_params.timeout = p_lcb->current_used_conn_timeout;
|
||||||
|
#if (BLE_INCLUDED == TRUE)
|
||||||
|
p_buf->int_conn.ble_addr_type = p_lcb->ble_addr_type;
|
||||||
|
#endif
|
||||||
|
p_buf->int_conn.conn_handle = p_lcb->handle;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
APPL_TRACE_WARNING("gattc_conn_cb: conn params not found");
|
APPL_TRACE_WARNING("gattc_conn_cb: conn params not found");
|
||||||
}
|
}
|
||||||
|
@ -765,7 +765,8 @@ void bta_gattc_send_open_cback( tBTA_GATTC_RCB *p_clreg, tBTA_GATT_STATUS status
|
|||||||
** Returns
|
** Returns
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void bta_gattc_send_connect_cback( tBTA_GATTC_RCB *p_clreg, BD_ADDR remote_bda, UINT16 conn_id, tBTA_GATT_CONN_PARAMS conn_params, UINT8 link_role)
|
void bta_gattc_send_connect_cback( tBTA_GATTC_RCB *p_clreg, BD_ADDR remote_bda, UINT16 conn_id,
|
||||||
|
tBTA_GATT_CONN_PARAMS conn_params, UINT8 link_role, UINT8 ble_addr_type, UINT16 conn_handle)
|
||||||
{
|
{
|
||||||
tBTA_GATTC cb_data;
|
tBTA_GATTC cb_data;
|
||||||
|
|
||||||
@ -779,6 +780,8 @@ void bta_gattc_send_connect_cback( tBTA_GATTC_RCB *p_clreg, BD_ADDR remote_bda,
|
|||||||
cb_data.connect.conn_params.latency = conn_params.latency;
|
cb_data.connect.conn_params.latency = conn_params.latency;
|
||||||
cb_data.connect.conn_params.timeout = conn_params.timeout;
|
cb_data.connect.conn_params.timeout = conn_params.timeout;
|
||||||
bdcpy(cb_data.connect.remote_bda, remote_bda);
|
bdcpy(cb_data.connect.remote_bda, remote_bda);
|
||||||
|
cb_data.connect.ble_addr_type = ble_addr_type;
|
||||||
|
cb_data.connect.conn_handle = conn_handle;
|
||||||
|
|
||||||
(*p_clreg->p_cback)(BTA_GATTC_CONNECT_EVT, &cb_data);
|
(*p_clreg->p_cback)(BTA_GATTC_CONNECT_EVT, &cb_data);
|
||||||
}
|
}
|
||||||
|
@ -1003,6 +1003,10 @@ static void bta_gatts_conn_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
|
|||||||
cb_data.conn.conn_params.latency = p_lcb->current_used_conn_latency;
|
cb_data.conn.conn_params.latency = p_lcb->current_used_conn_latency;
|
||||||
cb_data.conn.conn_params.timeout = p_lcb->current_used_conn_timeout;
|
cb_data.conn.conn_params.timeout = p_lcb->current_used_conn_timeout;
|
||||||
cb_data.conn.link_role = p_lcb->link_role;
|
cb_data.conn.link_role = p_lcb->link_role;
|
||||||
|
#if (BLE_INCLUDED == TRUE)
|
||||||
|
cb_data.conn.ble_addr_type = p_lcb->ble_addr_type;
|
||||||
|
#endif
|
||||||
|
cb_data.conn.conn_handle = p_lcb->handle;
|
||||||
}else {
|
}else {
|
||||||
APPL_TRACE_WARNING("%s not found connection parameters of the device ", __func__);
|
APPL_TRACE_WARNING("%s not found connection parameters of the device ", __func__);
|
||||||
}
|
}
|
||||||
|
@ -223,6 +223,8 @@ typedef struct {
|
|||||||
tGATT_DISCONN_REASON reason;
|
tGATT_DISCONN_REASON reason;
|
||||||
BOOLEAN already_connect;
|
BOOLEAN already_connect;
|
||||||
tBTA_GATT_CONN_PARAMS conn_params;
|
tBTA_GATT_CONN_PARAMS conn_params;
|
||||||
|
UINT8 ble_addr_type;
|
||||||
|
UINT16 conn_handle;
|
||||||
} tBTA_GATTC_INT_CONN;
|
} tBTA_GATTC_INT_CONN;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -474,7 +476,8 @@ extern void bta_gattc_init_bk_conn(tBTA_GATTC_API_OPEN *p_data, tBTA_GATTC_RCB *
|
|||||||
extern void bta_gattc_cancel_bk_conn(tBTA_GATTC_API_CANCEL_OPEN *p_data);
|
extern void bta_gattc_cancel_bk_conn(tBTA_GATTC_API_CANCEL_OPEN *p_data);
|
||||||
extern void bta_gattc_send_open_cback( tBTA_GATTC_RCB *p_clreg, tBTA_GATT_STATUS status,
|
extern void bta_gattc_send_open_cback( tBTA_GATTC_RCB *p_clreg, tBTA_GATT_STATUS status,
|
||||||
BD_ADDR remote_bda, UINT16 conn_id, tBTA_TRANSPORT transport, UINT16 mtu);
|
BD_ADDR remote_bda, UINT16 conn_id, tBTA_TRANSPORT transport, UINT16 mtu);
|
||||||
extern void bta_gattc_send_connect_cback( tBTA_GATTC_RCB *p_clreg, BD_ADDR remote_bda, UINT16 conn_id, tBTA_GATT_CONN_PARAMS conn_params, UINT8 link_role);
|
extern void bta_gattc_send_connect_cback( tBTA_GATTC_RCB *p_clreg, BD_ADDR remote_bda, UINT16 conn_id,
|
||||||
|
tBTA_GATT_CONN_PARAMS conn_params, UINT8 link_role, UINT8 ble_addr_type, UINT16 conn_handle);
|
||||||
extern void bta_gattc_send_disconnect_cback( tBTA_GATTC_RCB *p_clreg, tGATT_DISCONN_REASON reason,
|
extern void bta_gattc_send_disconnect_cback( tBTA_GATTC_RCB *p_clreg, tGATT_DISCONN_REASON reason,
|
||||||
BD_ADDR remote_bda, UINT16 conn_id);
|
BD_ADDR remote_bda, UINT16 conn_id);
|
||||||
extern void bta_gattc_process_api_refresh(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg);
|
extern void bta_gattc_process_api_refresh(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg);
|
||||||
|
@ -410,6 +410,8 @@ typedef struct {
|
|||||||
tBTA_GATTC_IF client_if;
|
tBTA_GATTC_IF client_if;
|
||||||
BD_ADDR remote_bda;
|
BD_ADDR remote_bda;
|
||||||
tBTA_GATT_CONN_PARAMS conn_params;
|
tBTA_GATT_CONN_PARAMS conn_params;
|
||||||
|
UINT8 ble_addr_type;
|
||||||
|
UINT16 conn_handle;
|
||||||
} tBTA_GATTC_CONNECT;
|
} tBTA_GATTC_CONNECT;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -621,6 +623,8 @@ typedef struct {
|
|||||||
tBTA_GATT_REASON reason; /* report disconnect reason */
|
tBTA_GATT_REASON reason; /* report disconnect reason */
|
||||||
tBTA_GATT_TRANSPORT transport;
|
tBTA_GATT_TRANSPORT transport;
|
||||||
tBTA_GATT_CONN_PARAMS conn_params;
|
tBTA_GATT_CONN_PARAMS conn_params;
|
||||||
|
UINT8 ble_addr_type;
|
||||||
|
UINT16 conn_handle;
|
||||||
} tBTA_GATTS_CONN;
|
} tBTA_GATTS_CONN;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -914,6 +914,8 @@ void btc_gattc_cb_handler(btc_msg_t *msg)
|
|||||||
param.connect.conn_params.interval = connect->conn_params.interval;
|
param.connect.conn_params.interval = connect->conn_params.interval;
|
||||||
param.connect.conn_params.latency = connect->conn_params.latency;
|
param.connect.conn_params.latency = connect->conn_params.latency;
|
||||||
param.connect.conn_params.timeout = connect->conn_params.timeout;
|
param.connect.conn_params.timeout = connect->conn_params.timeout;
|
||||||
|
param.connect.ble_addr_type = connect->ble_addr_type;
|
||||||
|
param.connect.conn_handle = connect->conn_handle;
|
||||||
btc_gattc_cb_to_app(ESP_GATTC_CONNECT_EVT, gattc_if, ¶m);
|
btc_gattc_cb_to_app(ESP_GATTC_CONNECT_EVT, gattc_if, ¶m);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -898,6 +898,8 @@ void btc_gatts_cb_handler(btc_msg_t *msg)
|
|||||||
param.connect.conn_params.interval = p_data->conn.conn_params.interval;
|
param.connect.conn_params.interval = p_data->conn.conn_params.interval;
|
||||||
param.connect.conn_params.latency = p_data->conn.conn_params.latency;
|
param.connect.conn_params.latency = p_data->conn.conn_params.latency;
|
||||||
param.connect.conn_params.timeout = p_data->conn.conn_params.timeout;
|
param.connect.conn_params.timeout = p_data->conn.conn_params.timeout;
|
||||||
|
param.connect.ble_addr_type = p_data->conn.ble_addr_type;
|
||||||
|
param.connect.conn_handle = p_data->conn.conn_handle;
|
||||||
btc_gatts_cb_to_app(ESP_GATTS_CONNECT_EVT, gatts_if, ¶m);
|
btc_gatts_cb_to_app(ESP_GATTS_CONNECT_EVT, gatts_if, ¶m);
|
||||||
break;
|
break;
|
||||||
case BTA_GATTS_DISCONNECT_EVT:
|
case BTA_GATTS_DISCONNECT_EVT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user