Loading system/btif/src/btif_av.cc +13 −17 Original line number Original line Diff line number Diff line Loading @@ -333,7 +333,7 @@ static bool btif_av_state_idle_handler(btif_sm_event_t event, void* p_data) { switch (event) { switch (event) { case BTIF_SM_ENTER_EVT: case BTIF_SM_ENTER_EVT: /* clear the peer_bda */ /* clear the peer_bda */ memset(&btif_av_cb.peer_bda, 0, sizeof(RawAddress)); btif_av_cb.peer_bda = RawAddress::kEmpty; btif_av_cb.flags = 0; btif_av_cb.flags = 0; btif_av_cb.edr = 0; btif_av_cb.edr = 0; bta_av_co_init(btif_av_cb.codec_priorities); bta_av_co_init(btif_av_cb.codec_priorities); Loading @@ -353,12 +353,10 @@ static bool btif_av_state_idle_handler(btif_sm_event_t event, void* p_data) { case BTA_AV_PENDING_EVT: case BTA_AV_PENDING_EVT: case BTIF_AV_CONNECT_REQ_EVT: { case BTIF_AV_CONNECT_REQ_EVT: { if (event == BTIF_AV_CONNECT_REQ_EVT) { if (event == BTIF_AV_CONNECT_REQ_EVT) { memcpy(&btif_av_cb.peer_bda, btif_av_connect_req_t* connect_req_p = (btif_av_connect_req_t*)p_data; ((btif_av_connect_req_t*)p_data)->target_bda, btif_av_cb.peer_bda = *connect_req_p->target_bda; sizeof(RawAddress)); BTA_AvOpen(btif_av_cb.peer_bda, btif_av_cb.bta_handle, true, BTA_AvOpen(btif_av_cb.peer_bda, btif_av_cb.bta_handle, true, BTA_SEC_AUTHENTICATE, BTA_SEC_AUTHENTICATE, connect_req_p->uuid); ((btif_av_connect_req_t*)p_data)->uuid); } else if (event == BTA_AV_PENDING_EVT) { } else if (event == BTA_AV_PENDING_EVT) { btif_av_cb.peer_bda = ((tBTA_AV*)p_data)->pend.bd_addr; btif_av_cb.peer_bda = ((tBTA_AV*)p_data)->pend.bd_addr; if (bt_av_src_callbacks != NULL) { if (bt_av_src_callbacks != NULL) { Loading Loading @@ -599,25 +597,23 @@ static bool btif_av_state_opening_handler(btif_sm_event_t event, void* p_data) { } } } break; } break; case BTIF_AV_CONNECT_REQ_EVT: case BTIF_AV_CONNECT_REQ_EVT: { // Check for device, if same device which moved to opening then ignore // Check for device, if same device which moved to opening then ignore // callback // callback if (memcmp(((btif_av_connect_req_t*)p_data)->target_bda, btif_av_connect_req_t* connect_req_p = (btif_av_connect_req_t*)p_data; &(btif_av_cb.peer_bda), sizeof(btif_av_cb.peer_bda)) == 0) { if (btif_av_cb.peer_bda == *connect_req_p->target_bda) { BTIF_TRACE_DEBUG( BTIF_TRACE_DEBUG( "%s: Same device moved to Opening state,ignore Connect Req", "%s: Same device moved to Opening state,ignore Connect Req", __func__); __func__); btif_queue_advance(); break; } else { } else { BTIF_TRACE_DEBUG("%s: Moved from idle by Incoming Connection request", BTIF_TRACE_DEBUG("%s: Moved from idle by Incoming Connection request", __func__); __func__); btif_report_connection_state( btif_report_connection_state( BTAV_CONNECTION_STATE_DISCONNECTED, BTAV_CONNECTION_STATE_DISCONNECTED, ((btif_av_connect_req_t*)p_data)->target_bda); ((btif_av_connect_req_t*)p_data)->target_bda); btif_queue_advance(); break; } } btif_queue_advance(); } break; case BTA_AV_PENDING_EVT: case BTA_AV_PENDING_EVT: // Check for device, if same device which moved to opening then ignore // Check for device, if same device which moved to opening then ignore Loading Loading @@ -869,9 +865,9 @@ static bool btif_av_state_opened_handler(btif_sm_event_t event, void* p_data) { } } break; break; case BTIF_AV_CONNECT_REQ_EVT: case BTIF_AV_CONNECT_REQ_EVT: { if (memcmp((RawAddress*)p_data, &(btif_av_cb.peer_bda), btif_av_connect_req_t* connect_req_p = (btif_av_connect_req_t*)p_data; sizeof(btif_av_cb.peer_bda)) == 0) { if (btif_av_cb.peer_bda == *connect_req_p->target_bda) { BTIF_TRACE_DEBUG("%s: Ignore BTIF_AV_CONNECT_REQ_EVT for same device", BTIF_TRACE_DEBUG("%s: Ignore BTIF_AV_CONNECT_REQ_EVT for same device", __func__); __func__); } else { } else { Loading @@ -881,7 +877,7 @@ static bool btif_av_state_opened_handler(btif_sm_event_t event, void* p_data) { (RawAddress*)p_data); (RawAddress*)p_data); } } btif_queue_advance(); btif_queue_advance(); break; } break; case BTIF_AV_OFFLOAD_START_REQ_EVT: case BTIF_AV_OFFLOAD_START_REQ_EVT: BTIF_TRACE_ERROR( BTIF_TRACE_ERROR( Loading system/btif/src/btif_core.cc +3 −3 Original line number Original line Diff line number Diff line Loading @@ -992,7 +992,7 @@ bt_status_t btif_set_adapter_property(const bt_property_t* property) { if (storage_req_id != BTIF_CORE_STORAGE_NO_ACTION) { if (storage_req_id != BTIF_CORE_STORAGE_NO_ACTION) { /* pass on to storage for updating local database */ /* pass on to storage for updating local database */ memset(&(req.write_req.bd_addr), 0, sizeof(RawAddress)); req.write_req.bd_addr = RawAddress::kEmpty; memcpy(&(req.write_req.prop), property, sizeof(bt_property_t)); memcpy(&(req.write_req.prop), property, sizeof(bt_property_t)); return btif_transfer_context(execute_storage_request, storage_req_id, return btif_transfer_context(execute_storage_request, storage_req_id, Loading @@ -1019,7 +1019,7 @@ bt_status_t btif_get_remote_device_property(RawAddress* remote_addr, if (!btif_is_enabled()) return BT_STATUS_NOT_READY; if (!btif_is_enabled()) return BT_STATUS_NOT_READY; memcpy(&(req.read_req.bd_addr), remote_addr, sizeof(RawAddress)); req.read_req.bd_addr = *remote_addr; req.read_req.type = type; req.read_req.type = type; return btif_transfer_context(execute_storage_remote_request, return btif_transfer_context(execute_storage_remote_request, BTIF_CORE_STORAGE_REMOTE_READ, (char*)&req, BTIF_CORE_STORAGE_REMOTE_READ, (char*)&req, Loading @@ -1040,7 +1040,7 @@ bt_status_t btif_get_remote_device_properties(RawAddress* remote_addr) { if (!btif_is_enabled()) return BT_STATUS_NOT_READY; if (!btif_is_enabled()) return BT_STATUS_NOT_READY; memcpy(&(req.read_req.bd_addr), remote_addr, sizeof(RawAddress)); req.read_req.bd_addr = *remote_addr; return btif_transfer_context(execute_storage_remote_request, return btif_transfer_context(execute_storage_remote_request, BTIF_CORE_STORAGE_REMOTE_READ_ALL, (char*)&req, BTIF_CORE_STORAGE_REMOTE_READ_ALL, (char*)&req, sizeof(btif_storage_req_t), NULL); sizeof(btif_storage_req_t), NULL); Loading system/btif/src/btif_profile_queue.cc +1 −1 Original line number Original line Diff line number Diff line Loading @@ -122,7 +122,7 @@ bt_status_t btif_queue_connect(uint16_t uuid, const RawAddress* bda, btif_connect_cb_t connect_cb) { btif_connect_cb_t connect_cb) { connect_node_t node; connect_node_t node; memset(&node, 0, sizeof(connect_node_t)); memset(&node, 0, sizeof(connect_node_t)); memcpy(&node.bda, bda, sizeof(RawAddress)); node.bda = *bda; node.uuid = uuid; node.uuid = uuid; node.connect_cb = connect_cb; node.connect_cb = connect_cb; Loading system/service/low_energy_client.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -35,7 +35,7 @@ namespace bluetooth { struct ConnComparator { struct ConnComparator { bool operator()(const RawAddress& a, const RawAddress& b) const { bool operator()(const RawAddress& a, const RawAddress& b) const { return memcmp(&a, &b, sizeof(RawAddress)) < 0; return memcmp(a.address, b.address, RawAddress::kLength) < 0; } } }; }; Loading system/stack/btm/btm_sec.cc +1 −1 Original line number Original line Diff line number Diff line Loading @@ -4984,7 +4984,7 @@ void btm_sec_pin_code_request(const RawAddress& p_bda) { btsnd_hcic_pin_code_neg_reply(p_bda); btsnd_hcic_pin_code_neg_reply(p_bda); return; return; } else if ((btm_cb.pairing_state != BTM_PAIR_STATE_WAIT_PIN_REQ) || } else if ((btm_cb.pairing_state != BTM_PAIR_STATE_WAIT_PIN_REQ) || p_bda == btm_cb.pairing_bda) { p_bda != btm_cb.pairing_bda) { BTM_TRACE_WARNING("btm_sec_pin_code_request() rejected - state: %s", BTM_TRACE_WARNING("btm_sec_pin_code_request() rejected - state: %s", btm_pair_state_descr(btm_cb.pairing_state)); btm_pair_state_descr(btm_cb.pairing_state)); btsnd_hcic_pin_code_neg_reply(p_bda); btsnd_hcic_pin_code_neg_reply(p_bda); Loading Loading
system/btif/src/btif_av.cc +13 −17 Original line number Original line Diff line number Diff line Loading @@ -333,7 +333,7 @@ static bool btif_av_state_idle_handler(btif_sm_event_t event, void* p_data) { switch (event) { switch (event) { case BTIF_SM_ENTER_EVT: case BTIF_SM_ENTER_EVT: /* clear the peer_bda */ /* clear the peer_bda */ memset(&btif_av_cb.peer_bda, 0, sizeof(RawAddress)); btif_av_cb.peer_bda = RawAddress::kEmpty; btif_av_cb.flags = 0; btif_av_cb.flags = 0; btif_av_cb.edr = 0; btif_av_cb.edr = 0; bta_av_co_init(btif_av_cb.codec_priorities); bta_av_co_init(btif_av_cb.codec_priorities); Loading @@ -353,12 +353,10 @@ static bool btif_av_state_idle_handler(btif_sm_event_t event, void* p_data) { case BTA_AV_PENDING_EVT: case BTA_AV_PENDING_EVT: case BTIF_AV_CONNECT_REQ_EVT: { case BTIF_AV_CONNECT_REQ_EVT: { if (event == BTIF_AV_CONNECT_REQ_EVT) { if (event == BTIF_AV_CONNECT_REQ_EVT) { memcpy(&btif_av_cb.peer_bda, btif_av_connect_req_t* connect_req_p = (btif_av_connect_req_t*)p_data; ((btif_av_connect_req_t*)p_data)->target_bda, btif_av_cb.peer_bda = *connect_req_p->target_bda; sizeof(RawAddress)); BTA_AvOpen(btif_av_cb.peer_bda, btif_av_cb.bta_handle, true, BTA_AvOpen(btif_av_cb.peer_bda, btif_av_cb.bta_handle, true, BTA_SEC_AUTHENTICATE, BTA_SEC_AUTHENTICATE, connect_req_p->uuid); ((btif_av_connect_req_t*)p_data)->uuid); } else if (event == BTA_AV_PENDING_EVT) { } else if (event == BTA_AV_PENDING_EVT) { btif_av_cb.peer_bda = ((tBTA_AV*)p_data)->pend.bd_addr; btif_av_cb.peer_bda = ((tBTA_AV*)p_data)->pend.bd_addr; if (bt_av_src_callbacks != NULL) { if (bt_av_src_callbacks != NULL) { Loading Loading @@ -599,25 +597,23 @@ static bool btif_av_state_opening_handler(btif_sm_event_t event, void* p_data) { } } } break; } break; case BTIF_AV_CONNECT_REQ_EVT: case BTIF_AV_CONNECT_REQ_EVT: { // Check for device, if same device which moved to opening then ignore // Check for device, if same device which moved to opening then ignore // callback // callback if (memcmp(((btif_av_connect_req_t*)p_data)->target_bda, btif_av_connect_req_t* connect_req_p = (btif_av_connect_req_t*)p_data; &(btif_av_cb.peer_bda), sizeof(btif_av_cb.peer_bda)) == 0) { if (btif_av_cb.peer_bda == *connect_req_p->target_bda) { BTIF_TRACE_DEBUG( BTIF_TRACE_DEBUG( "%s: Same device moved to Opening state,ignore Connect Req", "%s: Same device moved to Opening state,ignore Connect Req", __func__); __func__); btif_queue_advance(); break; } else { } else { BTIF_TRACE_DEBUG("%s: Moved from idle by Incoming Connection request", BTIF_TRACE_DEBUG("%s: Moved from idle by Incoming Connection request", __func__); __func__); btif_report_connection_state( btif_report_connection_state( BTAV_CONNECTION_STATE_DISCONNECTED, BTAV_CONNECTION_STATE_DISCONNECTED, ((btif_av_connect_req_t*)p_data)->target_bda); ((btif_av_connect_req_t*)p_data)->target_bda); btif_queue_advance(); break; } } btif_queue_advance(); } break; case BTA_AV_PENDING_EVT: case BTA_AV_PENDING_EVT: // Check for device, if same device which moved to opening then ignore // Check for device, if same device which moved to opening then ignore Loading Loading @@ -869,9 +865,9 @@ static bool btif_av_state_opened_handler(btif_sm_event_t event, void* p_data) { } } break; break; case BTIF_AV_CONNECT_REQ_EVT: case BTIF_AV_CONNECT_REQ_EVT: { if (memcmp((RawAddress*)p_data, &(btif_av_cb.peer_bda), btif_av_connect_req_t* connect_req_p = (btif_av_connect_req_t*)p_data; sizeof(btif_av_cb.peer_bda)) == 0) { if (btif_av_cb.peer_bda == *connect_req_p->target_bda) { BTIF_TRACE_DEBUG("%s: Ignore BTIF_AV_CONNECT_REQ_EVT for same device", BTIF_TRACE_DEBUG("%s: Ignore BTIF_AV_CONNECT_REQ_EVT for same device", __func__); __func__); } else { } else { Loading @@ -881,7 +877,7 @@ static bool btif_av_state_opened_handler(btif_sm_event_t event, void* p_data) { (RawAddress*)p_data); (RawAddress*)p_data); } } btif_queue_advance(); btif_queue_advance(); break; } break; case BTIF_AV_OFFLOAD_START_REQ_EVT: case BTIF_AV_OFFLOAD_START_REQ_EVT: BTIF_TRACE_ERROR( BTIF_TRACE_ERROR( Loading
system/btif/src/btif_core.cc +3 −3 Original line number Original line Diff line number Diff line Loading @@ -992,7 +992,7 @@ bt_status_t btif_set_adapter_property(const bt_property_t* property) { if (storage_req_id != BTIF_CORE_STORAGE_NO_ACTION) { if (storage_req_id != BTIF_CORE_STORAGE_NO_ACTION) { /* pass on to storage for updating local database */ /* pass on to storage for updating local database */ memset(&(req.write_req.bd_addr), 0, sizeof(RawAddress)); req.write_req.bd_addr = RawAddress::kEmpty; memcpy(&(req.write_req.prop), property, sizeof(bt_property_t)); memcpy(&(req.write_req.prop), property, sizeof(bt_property_t)); return btif_transfer_context(execute_storage_request, storage_req_id, return btif_transfer_context(execute_storage_request, storage_req_id, Loading @@ -1019,7 +1019,7 @@ bt_status_t btif_get_remote_device_property(RawAddress* remote_addr, if (!btif_is_enabled()) return BT_STATUS_NOT_READY; if (!btif_is_enabled()) return BT_STATUS_NOT_READY; memcpy(&(req.read_req.bd_addr), remote_addr, sizeof(RawAddress)); req.read_req.bd_addr = *remote_addr; req.read_req.type = type; req.read_req.type = type; return btif_transfer_context(execute_storage_remote_request, return btif_transfer_context(execute_storage_remote_request, BTIF_CORE_STORAGE_REMOTE_READ, (char*)&req, BTIF_CORE_STORAGE_REMOTE_READ, (char*)&req, Loading @@ -1040,7 +1040,7 @@ bt_status_t btif_get_remote_device_properties(RawAddress* remote_addr) { if (!btif_is_enabled()) return BT_STATUS_NOT_READY; if (!btif_is_enabled()) return BT_STATUS_NOT_READY; memcpy(&(req.read_req.bd_addr), remote_addr, sizeof(RawAddress)); req.read_req.bd_addr = *remote_addr; return btif_transfer_context(execute_storage_remote_request, return btif_transfer_context(execute_storage_remote_request, BTIF_CORE_STORAGE_REMOTE_READ_ALL, (char*)&req, BTIF_CORE_STORAGE_REMOTE_READ_ALL, (char*)&req, sizeof(btif_storage_req_t), NULL); sizeof(btif_storage_req_t), NULL); Loading
system/btif/src/btif_profile_queue.cc +1 −1 Original line number Original line Diff line number Diff line Loading @@ -122,7 +122,7 @@ bt_status_t btif_queue_connect(uint16_t uuid, const RawAddress* bda, btif_connect_cb_t connect_cb) { btif_connect_cb_t connect_cb) { connect_node_t node; connect_node_t node; memset(&node, 0, sizeof(connect_node_t)); memset(&node, 0, sizeof(connect_node_t)); memcpy(&node.bda, bda, sizeof(RawAddress)); node.bda = *bda; node.uuid = uuid; node.uuid = uuid; node.connect_cb = connect_cb; node.connect_cb = connect_cb; Loading
system/service/low_energy_client.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -35,7 +35,7 @@ namespace bluetooth { struct ConnComparator { struct ConnComparator { bool operator()(const RawAddress& a, const RawAddress& b) const { bool operator()(const RawAddress& a, const RawAddress& b) const { return memcmp(&a, &b, sizeof(RawAddress)) < 0; return memcmp(a.address, b.address, RawAddress::kLength) < 0; } } }; }; Loading
system/stack/btm/btm_sec.cc +1 −1 Original line number Original line Diff line number Diff line Loading @@ -4984,7 +4984,7 @@ void btm_sec_pin_code_request(const RawAddress& p_bda) { btsnd_hcic_pin_code_neg_reply(p_bda); btsnd_hcic_pin_code_neg_reply(p_bda); return; return; } else if ((btm_cb.pairing_state != BTM_PAIR_STATE_WAIT_PIN_REQ) || } else if ((btm_cb.pairing_state != BTM_PAIR_STATE_WAIT_PIN_REQ) || p_bda == btm_cb.pairing_bda) { p_bda != btm_cb.pairing_bda) { BTM_TRACE_WARNING("btm_sec_pin_code_request() rejected - state: %s", BTM_TRACE_WARNING("btm_sec_pin_code_request() rejected - state: %s", btm_pair_state_descr(btm_cb.pairing_state)); btm_pair_state_descr(btm_cb.pairing_state)); btsnd_hcic_pin_code_neg_reply(p_bda); btsnd_hcic_pin_code_neg_reply(p_bda); Loading