Lines Matching refs:peer_address
68 RawAddress peer_address; member
113 static bt_status_t sink_set_active_device(const RawAddress& peer_address);
225 BtifAvPeer(const RawAddress& peer_address, uint8_t peer_sep,
369 BtifAvPeer* FindPeer(const RawAddress& peer_address);
372 BtifAvPeer* FindOrCreatePeer(const RawAddress& peer_address,
382 bool AllowedToConnect(const RawAddress& peer_address) const;
390 bool DeletePeer(const RawAddress& peer_address);
411 bool IsPeerSilenced(const RawAddress& peer_address) { in IsPeerSilenced() argument
412 if (peer_address.IsEmpty()) { in IsPeerSilenced()
415 BtifAvPeer* peer = FindPeer(peer_address); in IsPeerSilenced()
434 bool SetSilencePeer(const RawAddress& peer_address, const bool silence) { in SetSilencePeer() argument
435 if (peer_address.IsEmpty()) { in SetSilencePeer()
439 peer_address.ToString().c_str()); in SetSilencePeer()
440 BtifAvPeer* peer = FindPeer(peer_address); in SetSilencePeer()
460 bool SetActivePeer(const RawAddress& peer_address, in SetActivePeer() argument
462 LOG(INFO) << __PRETTY_FUNCTION__ << ": peer: " << peer_address; in SetActivePeer()
464 if (active_peer_ == peer_address) { in SetActivePeer()
468 if (peer_address.IsEmpty()) { in SetActivePeer()
471 if (!bta_av_co_set_active_peer(peer_address)) { in SetActivePeer()
477 active_peer_ = peer_address; in SetActivePeer()
482 BtifAvPeer* peer = FindPeer(peer_address); in SetActivePeer()
490 if (!btif_a2dp_source_restart_session(active_peer_, peer_address, in SetActivePeer()
495 active_peer_ = peer_address; in SetActivePeer()
506 const RawAddress& peer_address, in UpdateCodecConfig() argument
510 if (!peer_address.IsEmpty() && active_peer_ == peer_address) { in UpdateCodecConfig()
515 peer_address, codec_preferences, std::move(peer_ready_promise)); in UpdateCodecConfig()
555 BtifAvPeer* FindPeer(const RawAddress& peer_address);
558 BtifAvPeer* FindOrCreatePeer(const RawAddress& peer_address,
568 bool AllowedToConnect(const RawAddress& peer_address) const;
576 bool DeletePeer(const RawAddress& peer_address);
598 bool SetActivePeer(const RawAddress& peer_address, in SetActivePeer() argument
600 LOG(INFO) << __PRETTY_FUNCTION__ << ": peer: " << peer_address; in SetActivePeer()
602 if (active_peer_ == peer_address) { in SetActivePeer()
606 if (peer_address.IsEmpty()) { in SetActivePeer()
609 if (!bta_av_co_set_active_peer(peer_address)) { in SetActivePeer()
615 active_peer_ = peer_address; in SetActivePeer()
620 BtifAvPeer* peer = FindPeer(peer_address); in SetActivePeer()
628 if (!btif_a2dp_sink_restart_session(active_peer_, peer_address, in SetActivePeer()
633 active_peer_ = peer_address; in SetActivePeer()
675 static bt_status_t src_disconnect_sink(const RawAddress& peer_address);
676 static bt_status_t sink_disconnect_src(const RawAddress& peer_address);
677 static void btif_av_source_dispatch_sm_event(const RawAddress& peer_address,
679 static void btif_av_sink_dispatch_sm_event(const RawAddress& peer_address,
682 const RawAddress& peer_address,
685 static void btif_report_connection_state(const RawAddress& peer_address,
687 static void btif_report_audio_state(const RawAddress& peer_address,
690 const RawAddress& peer_address, int sample_rate, int channel_count);
692 const RawAddress& peer_address);
695 static void bta_av_sink_media_callback(const RawAddress& peer_address,
699 static BtifAvPeer* btif_av_source_find_peer(const RawAddress& peer_address) { in btif_av_source_find_peer() argument
700 return btif_av_source.FindPeer(peer_address); in btif_av_source_find_peer()
702 static BtifAvPeer* btif_av_sink_find_peer(const RawAddress& peer_address) { in btif_av_sink_find_peer() argument
703 return btif_av_sink.FindPeer(peer_address); in btif_av_sink_find_peer()
705 static BtifAvPeer* btif_av_find_peer(const RawAddress& peer_address) { in btif_av_find_peer() argument
706 if (btif_av_source.Enabled()) return btif_av_source_find_peer(peer_address); in btif_av_find_peer()
707 if (btif_av_sink.Enabled()) return btif_av_sink_find_peer(peer_address); in btif_av_find_peer()
870 BtifAvPeer::BtifAvPeer(const RawAddress& peer_address, uint8_t peer_sep, in BtifAvPeer() argument
872 : peer_address_(peer_address), in BtifAvPeer()
1011 BtifAvPeer* BtifAvSource::FindPeer(const RawAddress& peer_address) { in FindPeer() argument
1012 auto it = peers_.find(peer_address); in FindPeer()
1037 BtifAvPeer* BtifAvSource::FindOrCreatePeer(const RawAddress& peer_address, in FindOrCreatePeer() argument
1040 peer_address.ToString().c_str(), bta_handle); in FindOrCreatePeer()
1042 BtifAvPeer* peer = FindPeer(peer_address); in FindOrCreatePeer()
1054 __PRETTY_FUNCTION__, peer_address.ToString().c_str()); in FindOrCreatePeer()
1065 __PRETTY_FUNCTION__, peer_address.ToString().c_str(), peer_id); in FindOrCreatePeer()
1072 __PRETTY_FUNCTION__, peer_address.ToString().c_str(), bta_handle, in FindOrCreatePeer()
1074 peer = new BtifAvPeer(peer_address, AVDT_TSEP_SNK, bta_handle, peer_id); in FindOrCreatePeer()
1075 peers_.insert(std::make_pair(peer_address, peer)); in FindOrCreatePeer()
1080 bool BtifAvSource::AllowedToConnect(const RawAddress& peer_address) const { in AllowedToConnect()
1090 if (peer->PeerAddress() == peer_address) { in AllowedToConnect()
1102 bool BtifAvSource::DeletePeer(const RawAddress& peer_address) { in DeletePeer() argument
1103 auto it = peers_.find(peer_address); in DeletePeer()
1214 BtifAvPeer* BtifAvSink::FindPeer(const RawAddress& peer_address) { in FindPeer() argument
1215 auto it = peers_.find(peer_address); in FindPeer()
1240 BtifAvPeer* BtifAvSink::FindOrCreatePeer(const RawAddress& peer_address, in FindOrCreatePeer() argument
1243 peer_address.ToString().c_str(), bta_handle); in FindOrCreatePeer()
1245 BtifAvPeer* peer = FindPeer(peer_address); in FindOrCreatePeer()
1257 __PRETTY_FUNCTION__, peer_address.ToString().c_str()); in FindOrCreatePeer()
1268 __PRETTY_FUNCTION__, peer_address.ToString().c_str(), peer_id); in FindOrCreatePeer()
1275 __PRETTY_FUNCTION__, peer_address.ToString().c_str(), bta_handle, in FindOrCreatePeer()
1277 peer = new BtifAvPeer(peer_address, AVDT_TSEP_SRC, bta_handle, peer_id); in FindOrCreatePeer()
1278 peers_.insert(std::make_pair(peer_address, peer)); in FindOrCreatePeer()
1281 active_peer_ = peer_address; in FindOrCreatePeer()
1286 bool BtifAvSink::AllowedToConnect(const RawAddress& peer_address) const { in AllowedToConnect()
1296 if (peer->PeerAddress() == peer_address) { in AllowedToConnect()
1308 bool BtifAvSink::DeletePeer(const RawAddress& peer_address) { in DeletePeer() argument
1309 auto it = peers_.find(peer_address); in DeletePeer()
1529 btif_av_report_sink_audio_config_state(p_config_req->peer_address, in ProcessEvent()
1744 btif_av_report_sink_audio_config_state(p_config_req->peer_address, in ProcessEvent()
2371 static void btif_report_connection_state(const RawAddress& peer_address, in btif_report_connection_state() argument
2374 peer_address.ToString().c_str(), state); in btif_report_connection_state()
2379 peer_address, state)); in btif_report_connection_state()
2383 peer_address, state)); in btif_report_connection_state()
2396 static void btif_report_audio_state(const RawAddress& peer_address, in btif_report_audio_state() argument
2399 peer_address.ToString().c_str(), state); in btif_report_audio_state()
2404 peer_address, state)); in btif_report_audio_state()
2408 peer_address, state)); in btif_report_audio_state()
2413 const RawAddress& peer_address, in btif_av_report_source_codec_state() argument
2419 peer_address.ToString().c_str()); in btif_av_report_source_codec_state()
2423 base::Bind(btif_av_source.Callbacks()->audio_config_cb, peer_address, in btif_av_report_source_codec_state()
2437 const RawAddress& peer_address, int sample_rate, int channel_count) { in btif_av_report_sink_audio_config_state() argument
2439 peer_address.ToString().c_str(), sample_rate, channel_count); in btif_av_report_sink_audio_config_state()
2443 peer_address, sample_rate, channel_count)); in btif_av_report_sink_audio_config_state()
2454 const RawAddress& peer_address) { in btif_av_query_mandatory_codec_priority() argument
2455 auto query_priority = [](const RawAddress& peer_address) { in btif_av_query_mandatory_codec_priority() argument
2456 auto apply_priority = [](const RawAddress& peer_address, bool preferred) { in btif_av_query_mandatory_codec_priority() argument
2457 BtifAvPeer* peer = btif_av_source_find_peer(peer_address); in btif_av_query_mandatory_codec_priority()
2466 btif_av_source.Callbacks()->mandatory_codec_preferred_cb(peer_address); in btif_av_query_mandatory_codec_priority()
2469 FROM_HERE, base::BindOnce(apply_priority, peer_address, preferred)); in btif_av_query_mandatory_codec_priority()
2473 do_in_jni_thread(FROM_HERE, base::BindOnce(query_priority, peer_address)); in btif_av_query_mandatory_codec_priority()
2489 const RawAddress& peer_address, in btif_av_handle_event() argument
2496 peer_address.ToString().c_str(), bta_handle, in btif_av_handle_event()
2500 if (peer_address != RawAddress::kEmpty) { in btif_av_handle_event()
2502 peer = btif_av_source.FindOrCreatePeer(peer_address, bta_handle); in btif_av_handle_event()
2504 peer = btif_av_sink.FindOrCreatePeer(peer_address, bta_handle); in btif_av_handle_event()
2518 peer_address.ToString().c_str(), bta_handle, in btif_av_handle_event()
2537 RawAddress peer_address = RawAddress::kEmpty; in btif_av_handle_bta_av_event() local
2567 peer_address = open.bd_addr; in btif_av_handle_bta_av_event()
2599 peer_address = rc_open.peer_addr; in btif_av_handle_bta_av_event()
2604 peer_address = rc_close.peer_addr; in btif_av_handle_bta_av_event()
2609 peer_address = rc_browse_open.peer_addr; in btif_av_handle_bta_av_event()
2614 peer_address = rc_browse_close.peer_addr; in btif_av_handle_bta_av_event()
2626 peer_address = btif_av_source.ActivePeer(); in btif_av_handle_bta_av_event()
2628 peer_address = btif_av_sink.ActivePeer(); in btif_av_handle_bta_av_event()
2639 peer_address = pend.bd_addr; in btif_av_handle_bta_av_event()
2644 peer_address = reject.bd_addr; in btif_av_handle_bta_av_event()
2650 peer_address = rc_feat.peer_addr; in btif_av_handle_bta_av_event()
2655 peer_address = rc_psm.peer_addr; in btif_av_handle_bta_av_event()
2660 peer_address.ToString().c_str(), bta_handle); in btif_av_handle_bta_av_event()
2662 btif_av_handle_event(peer_sep, peer_address, bta_handle, btif_av_event); in btif_av_handle_bta_av_event()
2682 static void bta_av_sink_media_callback(const RawAddress& peer_address, in bta_av_sink_media_callback() argument
2691 BtifAvPeer* peer = btif_av_sink_find_peer(peer_address); in bta_av_sink_media_callback()
2720 config_req.peer_address = p_data->avk_config.bd_addr; in bta_av_sink_media_callback()
2726 config_req.peer_address, kBtaHandleUnknown, in bta_av_sink_media_callback()
2764 static bt_status_t connect_int(RawAddress* peer_address, uint16_t uuid) { in connect_int() argument
2766 peer_address->ToString().c_str(), uuid); in connect_int()
2768 auto connection_task = [](RawAddress* peer_address, uint16_t uuid) { in connect_int() argument
2771 peer = btif_av_source.FindOrCreatePeer(*peer_address, kBtaHandleUnknown); in connect_int()
2773 peer = btif_av_sink.FindOrCreatePeer(*peer_address, kBtaHandleUnknown); in connect_int()
2782 FROM_HERE, base::BindOnce(connection_task, peer_address, uuid)); in connect_int()
2789 static void set_source_silence_peer_int(const RawAddress& peer_address, in set_source_silence_peer_int() argument
2792 peer_address.ToString().c_str(), silence ? "true" : "false"); in set_source_silence_peer_int()
2793 if (!btif_av_source.SetSilencePeer(peer_address, silence)) { in set_source_silence_peer_int()
2795 peer_address.ToString().c_str()); in set_source_silence_peer_int()
2801 const RawAddress& peer_address, in set_active_peer_int() argument
2805 peer_address.ToString().c_str()); in set_active_peer_int()
2808 if (!btif_av_source.SetActivePeer(peer_address, in set_active_peer_int()
2811 peer_address.ToString().c_str()); in set_active_peer_int()
2816 if (!btif_av_sink.SetActivePeer(peer_address, in set_active_peer_int()
2819 peer_address.ToString().c_str()); in set_active_peer_int()
2826 peer_address.ToString().c_str(), in set_active_peer_int()
2831 static bt_status_t src_connect_sink(const RawAddress& peer_address) { in src_connect_sink() argument
2832 BTIF_TRACE_EVENT("%s: Peer %s", __func__, peer_address.ToString().c_str()); in src_connect_sink()
2839 RawAddress peer_address_copy(peer_address); in src_connect_sink()
2844 static bt_status_t sink_connect_src(const RawAddress& peer_address) { in sink_connect_src() argument
2845 LOG_INFO("%s: Peer %s", __func__, peer_address.ToString().c_str()); in sink_connect_src()
2852 RawAddress peer_address_copy(peer_address); in sink_connect_src()
2857 static bt_status_t src_disconnect_sink(const RawAddress& peer_address) { in src_disconnect_sink() argument
2858 LOG_INFO("%s: Peer %s", __func__, peer_address.ToString().c_str()); in src_disconnect_sink()
2865 BtifAvEvent btif_av_event(BTIF_AV_DISCONNECT_REQ_EVT, &peer_address, in src_disconnect_sink()
2866 sizeof(peer_address)); in src_disconnect_sink()
2870 peer_address, kBtaHandleUnknown, btif_av_event)); in src_disconnect_sink()
2873 static bt_status_t sink_disconnect_src(const RawAddress& peer_address) { in sink_disconnect_src() argument
2874 LOG_INFO("%s: Peer %s", __func__, peer_address.ToString().c_str()); in sink_disconnect_src()
2881 BtifAvEvent btif_av_event(BTIF_AV_DISCONNECT_REQ_EVT, &peer_address, in sink_disconnect_src()
2882 sizeof(peer_address)); in sink_disconnect_src()
2886 peer_address, kBtaHandleUnknown, btif_av_event)); in sink_disconnect_src()
2889 static bt_status_t sink_set_active_device(const RawAddress& peer_address) { in sink_set_active_device() argument
2890 BTIF_TRACE_EVENT("%s: Peer %s", __func__, peer_address.ToString().c_str()); in sink_set_active_device()
2902 peer_address, std::move(peer_ready_promise))); in sink_set_active_device()
2911 static bt_status_t src_set_silence_sink(const RawAddress& peer_address, in src_set_silence_sink() argument
2913 BTIF_TRACE_EVENT("%s: Peer %s", __func__, peer_address.ToString().c_str()); in src_set_silence_sink()
2920 peer_address, silence)); in src_set_silence_sink()
2923 static bt_status_t src_set_active_sink(const RawAddress& peer_address) { in src_set_active_sink() argument
2924 BTIF_TRACE_EVENT("%s: Peer %s", __func__, peer_address.ToString().c_str()); in src_set_active_sink()
2936 peer_address, std::move(peer_ready_promise))); in src_set_active_sink()
2946 const RawAddress& peer_address, in codec_config_src() argument
2955 if (peer_address.IsEmpty()) { in codec_config_src()
2965 base::Unretained(&btif_av_source), peer_address, in codec_config_src()
3042 void btif_av_stream_stop(const RawAddress& peer_address) { in btif_av_stream_stop() argument
3043 LOG_INFO("%s peer %s", __func__, peer_address.ToString().c_str()); in btif_av_stream_stop()
3045 if (!peer_address.IsEmpty()) { in btif_av_stream_stop()
3046 btif_av_source_dispatch_sm_event(peer_address, BTIF_AV_STOP_STREAM_REQ_EVT); in btif_av_stream_stop()
3068 void btif_av_src_disconnect_sink(const RawAddress& peer_address) { in btif_av_src_disconnect_sink() argument
3069 LOG_INFO("%s: peer %s", __func__, peer_address.ToString().c_str()); in btif_av_src_disconnect_sink()
3070 src_disconnect_sink(peer_address); in btif_av_src_disconnect_sink()
3123 static void btif_av_source_dispatch_sm_event(const RawAddress& peer_address, in btif_av_source_dispatch_sm_event() argument
3127 peer_address.ToString().c_str(), in btif_av_source_dispatch_sm_event()
3133 peer_address, kBtaHandleUnknown, btif_av_event)); in btif_av_source_dispatch_sm_event()
3136 static void btif_av_sink_dispatch_sm_event(const RawAddress& peer_address, in btif_av_sink_dispatch_sm_event() argument
3140 peer_address.ToString().c_str(), in btif_av_sink_dispatch_sm_event()
3146 peer_address, kBtaHandleUnknown, btif_av_event)); in btif_av_sink_dispatch_sm_event()
3260 bool btif_av_is_peer_edr(const RawAddress& peer_address) { in btif_av_is_peer_edr() argument
3261 BtifAvPeer* peer = btif_av_find_peer(peer_address); in btif_av_is_peer_edr()
3264 peer_address.ToString().c_str()); in btif_av_is_peer_edr()
3269 peer_address.ToString().c_str()); in btif_av_is_peer_edr()
3275 peer_address.ToString().c_str(), is_edr); in btif_av_is_peer_edr()
3279 bool btif_av_peer_supports_3mbps(const RawAddress& peer_address) { in btif_av_peer_supports_3mbps() argument
3280 BtifAvPeer* peer = btif_av_find_peer(peer_address); in btif_av_peer_supports_3mbps()
3283 peer_address.ToString().c_str()); in btif_av_peer_supports_3mbps()
3290 peer_address.ToString().c_str(), is_connected, is3mbps); in btif_av_peer_supports_3mbps()
3294 bool btif_av_peer_prefers_mandatory_codec(const RawAddress& peer_address) { in btif_av_peer_prefers_mandatory_codec() argument
3295 BtifAvPeer* peer = btif_av_find_peer(peer_address); in btif_av_peer_prefers_mandatory_codec()
3298 peer_address.ToString().c_str()); in btif_av_peer_prefers_mandatory_codec()
3304 void btif_av_acl_disconnected(const RawAddress& peer_address) { in btif_av_acl_disconnected() argument
3307 peer_address.ToString().c_str()); in btif_av_acl_disconnected()
3310 btif_av_source_dispatch_sm_event(peer_address, BTIF_AV_ACL_DISCONNECTED); in btif_av_acl_disconnected()
3312 btif_av_sink_dispatch_sm_event(peer_address, BTIF_AV_ACL_DISCONNECTED); in btif_av_acl_disconnected()
3393 void btif_av_set_audio_delay(const RawAddress& peer_address, uint16_t delay) { in btif_av_set_audio_delay() argument
3395 BtifAvPeer* peer = btif_av_find_peer(peer_address); in btif_av_set_audio_delay()
3430 bool btif_av_is_peer_silenced(const RawAddress& peer_address) { in btif_av_is_peer_silenced() argument
3431 return btif_av_source.IsPeerSilenced(peer_address); in btif_av_is_peer_silenced()