From 4641f8499855c0b23e43fb1f42efbf466ac0cec2 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Thu, 3 Nov 2022 15:59:06 +0530 Subject: [PATCH] Nimble: Corrected macro used in memcpy to copy address --- .../bt/common/btc/profile/esp/blufi/nimble_host/esp_blufi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/bt/common/btc/profile/esp/blufi/nimble_host/esp_blufi.c b/components/bt/common/btc/profile/esp/blufi/nimble_host/esp_blufi.c index eec2f17a5c..33fa0bfb4f 100644 --- a/components/bt/common/btc/profile/esp/blufi/nimble_host/esp_blufi.c +++ b/components/bt/common/btc/profile/esp/blufi/nimble_host/esp_blufi.c @@ -492,7 +492,7 @@ int esp_blufi_handle_gap_events(struct ble_gap_event *event, void *arg) rc = ble_gap_conn_find(event->connect.conn_handle, &desc); assert(rc == 0); - memcpy(param.connect.remote_bda, desc.peer_id_addr.val, sizeof(esp_bd_addr_t)); + memcpy(param.connect.remote_bda, desc.peer_id_addr.val, ESP_BLUFI_BD_ADDR_LEN); param.connect.conn_id = event->connect.conn_handle; btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL); @@ -509,7 +509,7 @@ int esp_blufi_handle_gap_events(struct ble_gap_event *event, void *arg) memcpy(blufi_env.remote_bda, event->disconnect.conn.peer_id_addr.val, - sizeof(esp_bd_addr_t)); + ESP_BLUFI_BD_ADDR_LEN); if (blufi_env.aggr_buf != NULL) { osi_free(blufi_env.aggr_buf); @@ -521,7 +521,7 @@ int esp_blufi_handle_gap_events(struct ble_gap_event *event, void *arg) msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT; memcpy(param.disconnect.remote_bda, event->disconnect.conn.peer_id_addr.val, - sizeof(esp_bd_addr_t)); + ESP_BLUFI_BD_ADDR_LEN); btc_transfer_context(&msg, ¶m, sizeof(esp_blufi_cb_param_t), NULL); return 0; }