mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
component/bt: Change the gattc prepare write callback params.
This commit is contained in:
parent
1d13b58c62
commit
b07a5f03cf
@ -146,6 +146,7 @@ typedef union {
|
|||||||
esp_gatt_status_t status; /*!< Operation status */
|
esp_gatt_status_t status; /*!< Operation status */
|
||||||
uint16_t conn_id; /*!< Connection id */
|
uint16_t conn_id; /*!< Connection id */
|
||||||
uint16_t handle; /*!< The Characteristic or descriptor handle */
|
uint16_t handle; /*!< The Characteristic or descriptor handle */
|
||||||
|
uint16_t offset; /*!< The prepare write offset, this value is valid only when prepare write */
|
||||||
} write; /*!< Gatt client callback param of ESP_GATTC_WRITE_DESCR_EVT */
|
} write; /*!< Gatt client callback param of ESP_GATTC_WRITE_DESCR_EVT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -460,13 +460,16 @@ BOOLEAN bta_gattc_enqueue(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
|
|||||||
if (p_clcb->p_q_cmd == NULL) {
|
if (p_clcb->p_q_cmd == NULL) {
|
||||||
p_clcb->p_q_cmd = p_data;
|
p_clcb->p_q_cmd = p_data;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else if (p_data->hdr.event == BTA_GATTC_API_WRITE_EVT &&
|
} else if ((p_data->hdr.event == BTA_GATTC_API_WRITE_EVT &&
|
||||||
p_data->api_write.write_type == BTA_GATTC_WRITE_PREPARE &&
|
p_data->api_write.write_type == BTA_GATTC_WRITE_PREPARE) &&
|
||||||
p_data->api_write.handle == p_clcb->p_q_cmd->api_write.handle &&
|
((p_clcb->p_q_cmd->hdr.event == BTA_GATTC_API_WRITE_EVT &&
|
||||||
bta_gattc_has_prepare_command_in_queue(p_clcb)) {
|
p_clcb->p_q_cmd->api_write.write_type == BTA_GATTC_WRITE_PREPARE) ||
|
||||||
|
bta_gattc_has_prepare_command_in_queue(p_clcb))) {
|
||||||
|
APPL_TRACE_DEBUG("%s(), prepare offset = %d", __func__, p_data->api_write.offset);
|
||||||
cb_data.write.status = BTA_GATT_CONGESTED;
|
cb_data.write.status = BTA_GATT_CONGESTED;
|
||||||
cb_data.write.handle = p_data->api_write.handle;
|
cb_data.write.handle = p_data->api_write.handle;
|
||||||
cb_data.write.conn_id = p_clcb->bta_conn_id;
|
cb_data.write.conn_id = p_clcb->bta_conn_id;
|
||||||
|
cb_data.write.offset = p_data->api_write.offset;
|
||||||
/* write complete, callback */
|
/* write complete, callback */
|
||||||
if (p_clcb->p_rcb->p_cback != NULL) {
|
if (p_clcb->p_rcb->p_cback != NULL) {
|
||||||
( *p_clcb->p_rcb->p_cback)(BTA_GATTC_PREP_WRITE_EVT, (tBTA_GATTC *)&cb_data);
|
( *p_clcb->p_rcb->p_cback)(BTA_GATTC_PREP_WRITE_EVT, (tBTA_GATTC *)&cb_data);
|
||||||
|
@ -299,6 +299,7 @@ typedef struct {
|
|||||||
UINT16 conn_id;
|
UINT16 conn_id;
|
||||||
tBTA_GATT_STATUS status;
|
tBTA_GATT_STATUS status;
|
||||||
UINT16 handle;
|
UINT16 handle;
|
||||||
|
UINT16 offset;
|
||||||
}tBTA_GATTC_WRITE;
|
}tBTA_GATTC_WRITE;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -770,6 +770,7 @@ void btc_gattc_cb_handler(btc_msg_t *msg)
|
|||||||
param.write.conn_id = BTC_GATT_GET_CONN_ID(write->conn_id);
|
param.write.conn_id = BTC_GATT_GET_CONN_ID(write->conn_id);
|
||||||
param.write.status = write->status;
|
param.write.status = write->status;
|
||||||
param.write.handle = write->handle;
|
param.write.handle = write->handle;
|
||||||
|
param.write.offset = write->offset;
|
||||||
btc_gattc_cb_to_app(ret_evt, gattc_if, ¶m);
|
btc_gattc_cb_to_app(ret_evt, gattc_if, ¶m);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user