Lines Matching refs:peer
415 BtifAvPeer* peer = FindPeer(peer_address); in IsPeerSilenced() local
416 if (peer == nullptr) { in IsPeerSilenced()
420 if (!peer->IsConnected()) { in IsPeerSilenced()
424 return peer->IsInSilenceMode(); in IsPeerSilenced()
440 BtifAvPeer* peer = FindPeer(peer_address); in SetSilencePeer() local
441 if (peer == nullptr) { in SetSilencePeer()
445 if (!peer->IsConnected()) { in SetSilencePeer()
449 peer->SetSilence(silence); in SetSilencePeer()
482 BtifAvPeer* peer = FindPeer(peer_address); in SetActivePeer() local
483 if (peer != nullptr && !peer->IsConnected()) { in SetActivePeer()
484 LOG(ERROR) << __func__ << ": Error setting " << peer->PeerAddress() in SetActivePeer()
620 BtifAvPeer* peer = FindPeer(peer_address); in SetActivePeer() local
621 if (peer != nullptr && !peer->IsConnected()) { in SetActivePeer()
622 LOG(ERROR) << __func__ << ": Error setting " << peer->PeerAddress() in SetActivePeer()
1019 BtifAvPeer* peer = it.second; in FindPeerByHandle() local
1020 if (peer->BtaHandle() == bta_handle) { in FindPeerByHandle()
1021 return peer; in FindPeerByHandle()
1029 BtifAvPeer* peer = it.second; in FindPeerByPeerId() local
1030 if (peer->PeerId() == peer_id) { in FindPeerByPeerId()
1031 return peer; in FindPeerByPeerId()
1042 BtifAvPeer* peer = FindPeer(peer_address); in FindOrCreatePeer() local
1043 if (peer != nullptr) return peer; 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()
1076 peer->Init(); in FindOrCreatePeer()
1077 return peer; in FindOrCreatePeer()
1085 const BtifAvPeer* peer = it.second; in AllowedToConnect() local
1086 switch (peer->StateMachine().StateId()) { in AllowedToConnect()
1090 if (peer->PeerAddress() == peer_address) { in AllowedToConnect()
1105 BtifAvPeer* peer = it->second; in DeletePeer() local
1106 peer->Cleanup(); in DeletePeer()
1108 delete peer; in DeletePeer()
1114 BtifAvPeer* peer = it->second; in DeleteIdlePeers() local
1116 if (!peer->CanBeDeleted()) continue; in DeleteIdlePeers()
1118 peer->PeerAddress().ToString().c_str(), peer->BtaHandle()); in DeleteIdlePeers()
1119 peer->Cleanup(); in DeleteIdlePeers()
1121 delete peer; in DeleteIdlePeers()
1128 BtifAvPeer* peer = it->second; in CleanupAllPeers() local
1129 peer->Cleanup(); in CleanupAllPeers()
1131 delete peer; in CleanupAllPeers()
1155 BtifAvPeer* peer = FindPeerByPeerId(peer_id); in BtaHandleRegistered() local
1156 if (peer != nullptr && peer->BtaHandle() != bta_handle) { in BtaHandleRegistered()
1157 if (peer->BtaHandle() == kBtaHandleUnknown) { in BtaHandleRegistered()
1160 __PRETTY_FUNCTION__, peer->PeerAddress().ToString().c_str(), in BtaHandleRegistered()
1165 __PRETTY_FUNCTION__, peer->PeerAddress().ToString().c_str(), in BtaHandleRegistered()
1166 peer->BtaHandle(), bta_handle, peer_id); in BtaHandleRegistered()
1168 peer->SetBtaHandle(bta_handle); in BtaHandleRegistered()
1222 BtifAvPeer* peer = it.second; in FindPeerByHandle() local
1223 if (peer->BtaHandle() == bta_handle) { in FindPeerByHandle()
1224 return peer; in FindPeerByHandle()
1232 BtifAvPeer* peer = it.second; in FindPeerByPeerId() local
1233 if (peer->PeerId() == peer_id) { in FindPeerByPeerId()
1234 return peer; in FindPeerByPeerId()
1245 BtifAvPeer* peer = FindPeer(peer_address); in FindOrCreatePeer() local
1246 if (peer != nullptr) return peer; 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()
1279 peer->Init(); in FindOrCreatePeer()
1283 return peer; in FindOrCreatePeer()
1291 const BtifAvPeer* peer = it.second; in AllowedToConnect() local
1292 switch (peer->StateMachine().StateId()) { in AllowedToConnect()
1296 if (peer->PeerAddress() == peer_address) { in AllowedToConnect()
1311 BtifAvPeer* peer = it->second; in DeletePeer() local
1312 peer->Cleanup(); in DeletePeer()
1314 delete peer; in DeletePeer()
1320 BtifAvPeer* peer = it->second; in DeleteIdlePeers() local
1322 if (!peer->CanBeDeleted()) continue; in DeleteIdlePeers()
1324 peer->PeerAddress().ToString().c_str(), peer->BtaHandle()); in DeleteIdlePeers()
1325 peer->Cleanup(); in DeleteIdlePeers()
1327 delete peer; in DeleteIdlePeers()
1334 BtifAvPeer* peer = it->second; in CleanupAllPeers() local
1335 peer->Cleanup(); in CleanupAllPeers()
1337 delete peer; in CleanupAllPeers()
1360 BtifAvPeer* peer = FindPeerByPeerId(peer_id); in BtaHandleRegistered() local
1361 if (peer != nullptr && peer->BtaHandle() != bta_handle) { in BtaHandleRegistered()
1362 if (peer->BtaHandle() == kBtaHandleUnknown) { in BtaHandleRegistered()
1365 __PRETTY_FUNCTION__, peer->PeerAddress().ToString().c_str(), in BtaHandleRegistered()
1370 __PRETTY_FUNCTION__, peer->PeerAddress().ToString().c_str(), in BtaHandleRegistered()
1371 peer->BtaHandle(), bta_handle, peer_id); in BtaHandleRegistered()
1373 peer->SetBtaHandle(bta_handle); in BtaHandleRegistered()
2316 BtifAvPeer* peer = (BtifAvPeer*)data; in btif_av_source_initiate_av_open_timer_timeout() local
2319 peer->PeerAddress().ToString().c_str()); in btif_av_source_initiate_av_open_timer_timeout()
2322 if (!btif_rc_is_connected_peer(peer->PeerAddress())) { in btif_av_source_initiate_av_open_timer_timeout()
2324 peer->PeerAddress().ToString().c_str()); in btif_av_source_initiate_av_open_timer_timeout()
2330 btif_av_source.FindPeer(peer->PeerAddress()) == peer) { in btif_av_source_initiate_av_open_timer_timeout()
2332 peer->PeerAddress().ToString().c_str()); in btif_av_source_initiate_av_open_timer_timeout()
2333 btif_av_source_dispatch_sm_event(peer->PeerAddress(), in btif_av_source_initiate_av_open_timer_timeout()
2343 BtifAvPeer* peer = (BtifAvPeer*)data; in btif_av_sink_initiate_av_open_timer_timeout() local
2346 peer->PeerAddress().ToString().c_str()); in btif_av_sink_initiate_av_open_timer_timeout()
2349 if (!btif_rc_is_connected_peer(peer->PeerAddress())) { in btif_av_sink_initiate_av_open_timer_timeout()
2351 peer->PeerAddress().ToString().c_str()); in btif_av_sink_initiate_av_open_timer_timeout()
2357 btif_av_sink.FindPeer(peer->PeerAddress()) == peer) { in btif_av_sink_initiate_av_open_timer_timeout()
2359 peer->PeerAddress().ToString().c_str()); in btif_av_sink_initiate_av_open_timer_timeout()
2360 btif_av_sink_dispatch_sm_event(peer->PeerAddress(), in btif_av_sink_initiate_av_open_timer_timeout()
2457 BtifAvPeer* peer = btif_av_source_find_peer(peer_address); in btif_av_query_mandatory_codec_priority() local
2458 if (peer == nullptr) { in btif_av_query_mandatory_codec_priority()
2463 peer->SetMandatoryCodecPreferred(preferred); in btif_av_query_mandatory_codec_priority()
2492 BtifAvPeer* peer = nullptr; in btif_av_handle_event() local
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()
2508 peer = btif_av_source.FindPeerByHandle(bta_handle); in btif_av_handle_event()
2510 peer = btif_av_sink.FindPeerByHandle(bta_handle); in btif_av_handle_event()
2513 if (peer == nullptr) { in btif_av_handle_event()
2523 peer->StateMachine().ProcessEvent(btif_av_event.Event(), in btif_av_handle_event()
2691 BtifAvPeer* peer = btif_av_sink_find_peer(peer_address); in bta_av_sink_media_callback() local
2692 if (peer != nullptr && peer->IsActivePeer()) { in bta_av_sink_media_callback()
2693 int state = peer->StateMachine().StateId(); in bta_av_sink_media_callback()
2769 BtifAvPeer* peer = nullptr; in connect_int() local
2771 peer = btif_av_source.FindOrCreatePeer(*peer_address, kBtaHandleUnknown); in connect_int()
2773 peer = btif_av_sink.FindOrCreatePeer(*peer_address, kBtaHandleUnknown); in connect_int()
2775 if (peer == nullptr) { in connect_int()
2779 peer->StateMachine().ProcessEvent(BTIF_AV_CONNECT_REQ_EVT, nullptr); in connect_int()
2806 BtifAvPeer* peer = nullptr; in set_active_peer_int() local
2827 (peer == nullptr) ? "found" : "connected"); in set_active_peer_int()
3028 const BtifAvPeer* peer = it.second; in src_do_suspend_in_main_thread() local
3029 if (peer->StateMachine().StateId() == BtifAvStateMachine::kStateStarted) { in src_do_suspend_in_main_thread()
3030 btif_av_source_dispatch_sm_event(peer->PeerAddress(), event); in src_do_suspend_in_main_thread()
3080 BtifAvPeer* peer = btif_av_find_active_peer(); in btif_av_stream_ready() local
3081 if (peer == nullptr) { in btif_av_stream_ready()
3086 int state = peer->StateMachine().StateId(); in btif_av_stream_ready()
3088 peer->PeerAddress().ToString().c_str(), state, in btif_av_stream_ready()
3089 peer->FlagsToString().c_str()); in btif_av_stream_ready()
3091 if (peer->CheckFlags(BtifAvPeer::kFlagRemoteSuspend | in btif_av_stream_ready()
3100 BtifAvPeer* peer = btif_av_find_active_peer(); in btif_av_stream_started_ready() local
3101 if (peer == nullptr) { in btif_av_stream_started_ready()
3106 int state = peer->StateMachine().StateId(); in btif_av_stream_started_ready()
3108 if (peer->CheckFlags(BtifAvPeer::kFlagLocalSuspendPending | in btif_av_stream_started_ready()
3117 peer->PeerAddress().ToString().c_str(), state, in btif_av_stream_started_ready()
3118 peer->FlagsToString().c_str(), ready); in btif_av_stream_started_ready()
3220 BtifAvPeer* peer = btif_av_find_active_peer(); in btif_av_is_connected() local
3221 if (peer == nullptr) { in btif_av_is_connected()
3226 bool connected = peer->IsConnected(); in btif_av_is_connected()
3228 peer->PeerAddress().ToString().c_str(), in btif_av_is_connected()
3234 BtifAvPeer* peer = btif_av_find_active_peer(); in btif_av_get_peer_sep() local
3235 if (peer == nullptr) { in btif_av_get_peer_sep()
3240 uint8_t peer_sep = peer->PeerSep(); in btif_av_get_peer_sep()
3242 peer->PeerAddress().ToString().c_str(), in btif_av_get_peer_sep()
3248 BtifAvPeer* peer = btif_av_find_active_peer(); in btif_av_clear_remote_suspend_flag() local
3249 if (peer == nullptr) { in btif_av_clear_remote_suspend_flag()
3255 peer->PeerAddress().ToString().c_str(), in btif_av_clear_remote_suspend_flag()
3256 peer->FlagsToString().c_str()); in btif_av_clear_remote_suspend_flag()
3257 peer->ClearFlags(BtifAvPeer::kFlagRemoteSuspend); in btif_av_clear_remote_suspend_flag()
3261 BtifAvPeer* peer = btif_av_find_peer(peer_address); in btif_av_is_peer_edr() local
3262 if (peer == nullptr) { in btif_av_is_peer_edr()
3267 if (!peer->IsConnected()) { in btif_av_is_peer_edr()
3273 bool is_edr = peer->IsEdr(); in btif_av_is_peer_edr()
3280 BtifAvPeer* peer = btif_av_find_peer(peer_address); in btif_av_peer_supports_3mbps() local
3281 if (peer == nullptr) { in btif_av_peer_supports_3mbps()
3287 bool is3mbps = peer->Is3Mbps(); in btif_av_peer_supports_3mbps()
3288 bool is_connected = peer->IsConnected(); in btif_av_peer_supports_3mbps()
3295 BtifAvPeer* peer = btif_av_find_peer(peer_address); in btif_av_peer_prefers_mandatory_codec() local
3296 if (peer == nullptr) { in btif_av_peer_prefers_mandatory_codec()
3301 return peer->IsMandatoryCodecPreferred(); in btif_av_peer_prefers_mandatory_codec()
3316 static void btif_debug_av_peer_dump(int fd, const BtifAvPeer& peer) { in btif_debug_av_peer_dump() argument
3318 int state = peer.StateMachine().StateId(); in btif_debug_av_peer_dump()
3340 dprintf(fd, " Peer: %s\n", peer.PeerAddress().ToString().c_str()); in btif_debug_av_peer_dump()
3341 dprintf(fd, " Connected: %s\n", peer.IsConnected() ? "true" : "false"); in btif_debug_av_peer_dump()
3342 dprintf(fd, " Streaming: %s\n", peer.IsStreaming() ? "true" : "false"); in btif_debug_av_peer_dump()
3343 dprintf(fd, " SEP: %d(%s)\n", peer.PeerSep(), in btif_debug_av_peer_dump()
3344 (peer.IsSource()) ? "Source" : "Sink"); in btif_debug_av_peer_dump()
3346 dprintf(fd, " Flags: %s\n", peer.FlagsToString().c_str()); in btif_debug_av_peer_dump()
3348 alarm_is_scheduled(peer.AvOpenOnRcTimer()) ? "Scheduled" in btif_debug_av_peer_dump()
3350 dprintf(fd, " BTA Handle: 0x%x\n", peer.BtaHandle()); in btif_debug_av_peer_dump()
3351 dprintf(fd, " Peer ID: %d\n", peer.PeerId()); in btif_debug_av_peer_dump()
3352 dprintf(fd, " EDR: %s\n", peer.IsEdr() ? "true" : "false"); in btif_debug_av_peer_dump()
3353 dprintf(fd, " Support 3Mbps: %s\n", peer.Is3Mbps() ? "true" : "false"); in btif_debug_av_peer_dump()
3355 peer.SelfInitiatedConnection() ? "true" : "false"); in btif_debug_av_peer_dump()
3356 dprintf(fd, " Delay Reporting: %u\n", peer.GetDelayReport()); in btif_debug_av_peer_dump()
3358 peer.IsMandatoryCodecPreferred() ? "Mandatory" : "Optional"); in btif_debug_av_peer_dump()
3369 const BtifAvPeer* peer = it.second; in btif_debug_av_source_dump() local
3370 btif_debug_av_peer_dump(fd, *peer); in btif_debug_av_source_dump()
3383 const BtifAvPeer* peer = it.second; in btif_debug_av_sink_dump() local
3384 btif_debug_av_peer_dump(fd, *peer); in btif_debug_av_sink_dump()
3395 BtifAvPeer* peer = btif_av_find_peer(peer_address); in btif_av_set_audio_delay() local
3396 if (peer != nullptr && peer->IsSink()) { in btif_av_set_audio_delay()
3397 peer->SetDelayReport(delay); in btif_av_set_audio_delay()
3398 if (peer->IsActivePeer()) { in btif_av_set_audio_delay()
3399 bluetooth::audio::a2dp::set_remote_delay(peer->GetDelayReport()); in btif_av_set_audio_delay()
3405 BtifAvPeer* peer = btif_av_find_active_peer(); in btif_av_get_audio_delay() local
3406 if (peer != nullptr && peer->IsSink()) { in btif_av_get_audio_delay()
3407 return peer->GetDelayReport(); in btif_av_get_audio_delay()