From: Tian Hao Date: Wed, 7 Dec 2016 06:18:07 +0000 (+0800) Subject: component/bt : fix bug of bdaddr point to resolve gattc recv notify X-Git-Tag: v2.0-rc1~132^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8185b0f8063bf1157971faa55d953b7ad93ff682;p=esp-idf component/bt : fix bug of bdaddr point to resolve gattc recv notify --- diff --git a/components/bt/bluedroid/api/esp_gattc_api.c b/components/bt/bluedroid/api/esp_gattc_api.c index 3c17f73371..c856947f01 100644 --- a/components/bt/bluedroid/api/esp_gattc_api.c +++ b/components/bt/bluedroid/api/esp_gattc_api.c @@ -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)); diff --git a/components/bt/bluedroid/btc/profile/std/gatt/btc_gattc.c b/components/bt/bluedroid/btc/profile/std/gatt/btc_gattc.c index 92cd5001db..b5da7ed249 100644 --- a/components/bt/bluedroid/btc/profile/std/gatt/btc_gattc.c +++ b/components/bt/bluedroid/btc/profile/std/gatt/btc_gattc.c @@ -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(¶m.notify.remote_bda, ¬ify->bda, sizeof(esp_bd_addr_t)); + memcpy(param.notify.remote_bda, notify->bda, sizeof(esp_bd_addr_t)); bta_to_btc_srvc_id(¶m.notify.srvc_id, ¬ify->char_id.srvc_id); bta_to_btc_gatt_id(¶m.notify.char_id, ¬ify->char_id.char_id); bta_to_btc_gatt_id(¶m.notify.descr_id, ¬ify->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(¶m.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, ¶m); 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(¶m.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, ¶m); break; @@ -646,7 +646,7 @@ void btc_gattc_cb_handler(btc_msg_t *msg) break; } case BTA_GATTC_SRVC_CHG_EVT: { - memcpy(¶m.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, ¶m); break; }