component/bt : fix bug of bdaddr point to resolve gattc recv notify

This commit is contained in:
Tian Hao
2016-12-07 14:18:07 +08:00
parent f68e1c22ab
commit 8185b0f806
2 changed files with 6 additions and 6 deletions

View File

@@ -340,7 +340,7 @@ esp_gatt_status_t esp_ble_gattc_register_for_notify (esp_gatt_if_t gatt_if,
msg.pid = BTC_PID_GATTC;
msg.act = BTC_GATTC_ACT_REG_FOR_NOTIFY;
arg.reg_for_notify.gatt_if = gatt_if;
memcpy(&arg.reg_for_notify.remote_bda, &server_bda, sizeof(esp_bd_addr_t));
memcpy(arg.reg_for_notify.remote_bda, server_bda, sizeof(esp_bd_addr_t));
memcpy(&arg.reg_for_notify.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t));
memcpy(&arg.reg_for_notify.char_id, char_id, sizeof(esp_gatt_id_t));
@@ -359,7 +359,7 @@ esp_gatt_status_t esp_ble_gattc_unregister_for_notify (esp_gatt_if_t gatt_if,
msg.pid = BTC_PID_GATTC;
msg.act = BTC_GATTC_ACT_UNREG_FOR_NOTIFY;
arg.unreg_for_notify.gatt_if = gatt_if;
memcpy(&arg.unreg_for_notify.remote_bda, &server_bda, sizeof(esp_bd_addr_t));
memcpy(arg.unreg_for_notify.remote_bda, server_bda, sizeof(esp_bd_addr_t));
memcpy(&arg.unreg_for_notify.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t));
memcpy(&arg.unreg_for_notify.char_id, char_id, sizeof(esp_gatt_id_t));

View File

@@ -584,7 +584,7 @@ void btc_gattc_cb_handler(btc_msg_t *msg)
case BTA_GATTC_NOTIF_EVT: {
tBTA_GATTC_NOTIFY *notify = &arg->notify;
param.notify.conn_id = notify->conn_id;
memcpy(&param.notify.remote_bda, &notify->bda, sizeof(esp_bd_addr_t));
memcpy(param.notify.remote_bda, notify->bda, sizeof(esp_bd_addr_t));
bta_to_btc_srvc_id(&param.notify.srvc_id, &notify->char_id.srvc_id);
bta_to_btc_gatt_id(&param.notify.char_id, &notify->char_id.char_id);
bta_to_btc_gatt_id(&param.notify.descr_id, &notify->descr_type);
@@ -605,7 +605,7 @@ void btc_gattc_cb_handler(btc_msg_t *msg)
param.open.status = open->status;
param.open.conn_id = open->conn_id;
param.open.gatt_if = open->client_if;
memcpy(&param.open.remote_bda, &open->remote_bda, sizeof(esp_bd_addr_t));
memcpy(param.open.remote_bda, open->remote_bda, sizeof(esp_bd_addr_t));
param.open.mtu = open->mtu;
BTC_GATTC_CB_TO_APP(ESP_GATTC_OPEN_EVT, &param);
break;
@@ -615,7 +615,7 @@ void btc_gattc_cb_handler(btc_msg_t *msg)
param.close.status = close->status;
param.close.conn_id = close->conn_id;
param.close.gatt_if = close->client_if;
memcpy(&param.close.remote_bda, &close->remote_bda, sizeof(esp_bd_addr_t));
memcpy(param.close.remote_bda, close->remote_bda, sizeof(esp_bd_addr_t));
param.close.reason = close->reason;
BTC_GATTC_CB_TO_APP(ESP_GATTC_CLOSE_EVT, &param);
break;
@@ -646,7 +646,7 @@ void btc_gattc_cb_handler(btc_msg_t *msg)
break;
}
case BTA_GATTC_SRVC_CHG_EVT: {
memcpy(&param.srvc_chg.remote_bda, &arg->remote_bda, sizeof(esp_bd_addr_t));
memcpy(param.srvc_chg.remote_bda, arg->remote_bda, sizeof(esp_bd_addr_t));
BTC_GATTC_CB_TO_APP(ESP_GATTC_SRVC_CHG_EVT, &param);
break;
}