component/bt: Change the gattc prepare write callback params.

pull/1278/merge
Yulong 2017-11-14 07:00:45 -05:00
rodzic 1d13b58c62
commit b07a5f03cf
4 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -146,6 +146,7 @@ typedef union {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
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 */
/**

Wyświetl plik

@ -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) {
p_clcb->p_q_cmd = p_data;
return TRUE;
} 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.handle == p_clcb->p_q_cmd->api_write.handle &&
bta_gattc_has_prepare_command_in_queue(p_clcb)) {
} else if ((p_data->hdr.event == BTA_GATTC_API_WRITE_EVT &&
p_data->api_write.write_type == BTA_GATTC_WRITE_PREPARE) &&
((p_clcb->p_q_cmd->hdr.event == BTA_GATTC_API_WRITE_EVT &&
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.handle = p_data->api_write.handle;
cb_data.write.conn_id = p_clcb->bta_conn_id;
cb_data.write.offset = p_data->api_write.offset;
/* write complete, callback */
if (p_clcb->p_rcb->p_cback != NULL) {
( *p_clcb->p_rcb->p_cback)(BTA_GATTC_PREP_WRITE_EVT, (tBTA_GATTC *)&cb_data);

Wyświetl plik

@ -299,6 +299,7 @@ typedef struct {
UINT16 conn_id;
tBTA_GATT_STATUS status;
UINT16 handle;
UINT16 offset;
}tBTA_GATTC_WRITE;
typedef struct {

Wyświetl plik

@ -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.status = write->status;
param.write.handle = write->handle;
param.write.offset = write->offset;
btc_gattc_cb_to_app(ret_evt, gattc_if, &param);
break;
}