]> granicus.if.org Git - esp-idf/commitdiff
component/bt : fix bug of bdaddr point to resolve gattc recv notify
authorTian Hao <tianhao@espressif.com>
Wed, 7 Dec 2016 06:18:07 +0000 (14:18 +0800)
committerTian Hao <tianhao@espressif.com>
Fri, 9 Dec 2016 06:38:21 +0000 (14:38 +0800)
components/bt/bluedroid/api/esp_gattc_api.c
components/bt/bluedroid/btc/profile/std/gatt/btc_gattc.c

index 3c17f73371f85f549a671037df625ffa4cd9a714..c856947f01472b1a657d43bb6e6a8c779ba7c2ac 100644 (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));
 
index 92cd5001db45ffb234816b3271e8d626f99afaa2..b5da7ed2490e76b382289ea21abcad98e4d998b5 100644 (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;
     }