From: wangmengyang Date: Tue, 6 Dec 2016 12:20:56 +0000 (+0800) Subject: component/bt: bug fix for incorrect copy of Bluetooth device address X-Git-Tag: v2.1-rc1~196^2~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc5bc0f0263b60697d2d6d3fe883b5da1f0a5aa6;p=esp-idf component/bt: bug fix for incorrect copy of Bluetooth device address --- diff --git a/examples/09_a2dp/components/bluedroid_demos/btif/btif_avk.c b/examples/09_a2dp/components/bluedroid_demos/btif/btif_avk.c index ffd9f2af62..e14cdfd86c 100644 --- a/examples/09_a2dp/components/bluedroid_demos/btif/btif_avk.c +++ b/examples/09_a2dp/components/bluedroid_demos/btif/btif_avk.c @@ -213,7 +213,7 @@ static void btif_report_connection_state(esp_a2d_connection_state_t state, bt_bd param.conn_stat.state = state; if (bd_addr) { - memcpy(¶m.conn_stat.remote_bda, bd_addr, sizeof(esp_bd_addr_t)); + memcpy(param.conn_stat.remote_bda, bd_addr, sizeof(esp_bd_addr_t)); } BTIF_A2D_CB_TO_APP(ESP_A2D_CONNECTION_STATE_EVT, ¶m); } @@ -225,7 +225,7 @@ static void btif_report_audio_state(esp_a2d_audio_state_t state, bt_bdaddr_t *bd param.audio_stat.state = state; if (bd_addr) { - memcpy(¶m.audio_stat.remote_bda, bd_addr, sizeof(esp_bd_addr_t)); + memcpy(param.audio_stat.remote_bda, bd_addr, sizeof(esp_bd_addr_t)); } BTIF_A2D_CB_TO_APP(ESP_A2D_AUDIO_STATE_EVT, ¶m); } @@ -372,7 +372,7 @@ static BOOLEAN btif_av_state_opening_handler(btif_sm_event_t event, void *p_data case BTIF_AV_SINK_CONFIG_REQ_EVT: { if (btif_av_cb.peer_sep == AVDT_TSEP_SRC) { esp_a2d_cb_param_t param; - memcpy(¶m.audio_cfg.remote_bda, &btif_av_cb.peer_bda, sizeof(esp_bd_addr_t)); + memcpy(param.audio_cfg.remote_bda, &btif_av_cb.peer_bda, sizeof(esp_bd_addr_t)); memcpy(¶m.audio_cfg.mcc, p_data, sizeof(esp_a2d_mcc_t)); BTIF_A2D_CB_TO_APP(ESP_A2D_AUDIO_CFG_EVT, ¶m); } @@ -938,7 +938,7 @@ static bt_status_t connect_int(bt_bdaddr_t *bd_addr, uint16_t uuid) return BT_STATUS_SUCCESS; } -esp_err_t esp_a2d_sink_connect(esp_bd_addr_t *remote_bda) +esp_err_t esp_a2d_sink_connect(esp_bd_addr_t remote_bda) { BTIF_TRACE_EVENT("%s\n", __FUNCTION__); CHECK_BTAV_INIT(); @@ -951,7 +951,7 @@ esp_err_t esp_a2d_sink_connect(esp_bd_addr_t *remote_bda) return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; } -esp_err_t esp_a2d_sink_disconnect(esp_bd_addr_t *remote_bda) +esp_err_t esp_a2d_sink_disconnect(esp_bd_addr_t remote_bda) { bt_status_t stat; bt_bdaddr_t bd_addr; diff --git a/examples/09_a2dp/components/bluedroid_demos/include/esp_a2dp_api.h b/examples/09_a2dp/components/bluedroid_demos/include/esp_a2dp_api.h index b2b20241e9..7e26a91bb2 100644 --- a/examples/09_a2dp/components/bluedroid_demos/include/esp_a2dp_api.h +++ b/examples/09_a2dp/components/bluedroid_demos/include/esp_a2dp_api.h @@ -103,9 +103,9 @@ esp_err_t esp_a2d_register_data_callback(esp_a2d_data_cb_t cb); esp_err_t esp_a2d_sink_init(void); -esp_err_t esp_a2d_sink_connect(esp_bd_addr_t *remote_bda); +esp_err_t esp_a2d_sink_connect(esp_bd_addr_t remote_bda); -esp_err_t esp_a2d_sink_disconnect(esp_bd_addr_t *remote_bda); +esp_err_t esp_a2d_sink_disconnect(esp_bd_addr_t remote_bda); void esp_a2d_sink_deinit(void);