Lines Matching refs:peer
402 BtifAvPeer* peer = FindPeer(peer_address); in IsPeerSilenced() local
403 if (peer == nullptr) { in IsPeerSilenced()
407 if (!peer->IsConnected()) { in IsPeerSilenced()
411 return peer->IsInSilenceMode(); in IsPeerSilenced()
427 BtifAvPeer* peer = FindPeer(peer_address); in SetSilencePeer() local
428 if (peer == nullptr) { in SetSilencePeer()
432 if (!peer->IsConnected()) { in SetSilencePeer()
436 peer->SetSilence(silence); in SetSilencePeer()
469 BtifAvPeer* peer = FindPeer(peer_address); in SetActivePeer() local
470 if (peer != nullptr && !peer->IsConnected()) { in SetActivePeer()
471 LOG(ERROR) << __func__ << ": Error setting " << peer->PeerAddress() in SetActivePeer()
618 BtifAvPeer* peer = FindPeer(peer_address); in SetActivePeer() local
619 if (peer != nullptr && !peer->IsConnected()) { in SetActivePeer()
620 LOG(ERROR) << __func__ << ": Error setting " << peer->PeerAddress() in SetActivePeer()
1006 BtifAvPeer* peer = it.second; in FindPeerByHandle() local
1007 if (peer->BtaHandle() == bta_handle) { in FindPeerByHandle()
1008 return peer; in FindPeerByHandle()
1016 BtifAvPeer* peer = it.second; in FindPeerByPeerId() local
1017 if (peer->PeerId() == peer_id) { in FindPeerByPeerId()
1018 return peer; in FindPeerByPeerId()
1029 BtifAvPeer* peer = FindPeer(peer_address); in FindOrCreatePeer() local
1030 if (peer != nullptr) return peer; in FindOrCreatePeer()
1056 peer = new BtifAvPeer(peer_address, AVDT_TSEP_SNK, bta_handle, peer_id); in FindOrCreatePeer()
1057 peers_.insert(std::make_pair(peer_address, peer)); in FindOrCreatePeer()
1058 peer->Init(); in FindOrCreatePeer()
1059 return peer; in FindOrCreatePeer()
1067 const BtifAvPeer* peer = it.second; in AllowedToConnect() local
1068 switch (peer->StateMachine().StateId()) { in AllowedToConnect()
1072 if (peer->PeerAddress() == peer_address) { in AllowedToConnect()
1087 BtifAvPeer* peer = it->second; in DeletePeer() local
1088 peer->Cleanup(); in DeletePeer()
1090 delete peer; in DeletePeer()
1096 BtifAvPeer* peer = it->second; in DeleteIdlePeers() local
1098 if (!peer->CanBeDeleted()) continue; in DeleteIdlePeers()
1100 peer->PeerAddress().ToString().c_str(), peer->BtaHandle()); in DeleteIdlePeers()
1101 peer->Cleanup(); in DeleteIdlePeers()
1103 delete peer; in DeleteIdlePeers()
1110 BtifAvPeer* peer = it->second; in CleanupAllPeers() local
1111 peer->Cleanup(); in CleanupAllPeers()
1113 delete peer; in CleanupAllPeers()
1137 BtifAvPeer* peer = FindPeerByPeerId(peer_id); in BtaHandleRegistered() local
1138 if (peer != nullptr) { in BtaHandleRegistered()
1139 peer->SetBtaHandle(bta_handle); in BtaHandleRegistered()
1193 BtifAvPeer* peer = it.second; in FindPeerByHandle() local
1194 if (peer->BtaHandle() == bta_handle) { in FindPeerByHandle()
1195 return peer; in FindPeerByHandle()
1203 BtifAvPeer* peer = it.second; in FindPeerByPeerId() local
1204 if (peer->PeerId() == peer_id) { in FindPeerByPeerId()
1205 return peer; in FindPeerByPeerId()
1216 BtifAvPeer* peer = FindPeer(peer_address); in FindOrCreatePeer() local
1217 if (peer != nullptr) return peer; in FindOrCreatePeer()
1244 peer = new BtifAvPeer(peer_address, AVDT_TSEP_SRC, bta_handle, peer_id); in FindOrCreatePeer()
1245 peers_.insert(std::make_pair(peer_address, peer)); in FindOrCreatePeer()
1246 peer->Init(); in FindOrCreatePeer()
1250 return peer; in FindOrCreatePeer()
1258 const BtifAvPeer* peer = it.second; in AllowedToConnect() local
1259 switch (peer->StateMachine().StateId()) { in AllowedToConnect()
1263 if (peer->PeerAddress() == peer_address) { in AllowedToConnect()
1278 BtifAvPeer* peer = it->second; in DeletePeer() local
1279 peer->Cleanup(); in DeletePeer()
1281 delete peer; in DeletePeer()
1287 BtifAvPeer* peer = it->second; in DeleteIdlePeers() local
1289 if (!peer->CanBeDeleted()) continue; in DeleteIdlePeers()
1291 peer->PeerAddress().ToString().c_str(), peer->BtaHandle()); in DeleteIdlePeers()
1292 peer->Cleanup(); in DeleteIdlePeers()
1294 delete peer; in DeleteIdlePeers()
1301 BtifAvPeer* peer = it->second; in CleanupAllPeers() local
1302 peer->Cleanup(); in CleanupAllPeers()
1304 delete peer; in CleanupAllPeers()
1327 BtifAvPeer* peer = FindPeerByPeerId(peer_id); in BtaHandleRegistered() local
1328 if (peer != nullptr) { in BtaHandleRegistered()
1329 peer->SetBtaHandle(bta_handle); in BtaHandleRegistered()
2235 BtifAvPeer* peer = (BtifAvPeer*)data; in btif_av_source_initiate_av_open_timer_timeout() local
2238 peer->PeerAddress().ToString().c_str()); in btif_av_source_initiate_av_open_timer_timeout()
2241 if (!btif_rc_is_connected_peer(peer->PeerAddress())) { in btif_av_source_initiate_av_open_timer_timeout()
2243 peer->PeerAddress().ToString().c_str()); in btif_av_source_initiate_av_open_timer_timeout()
2249 btif_av_source.FindPeer(peer->PeerAddress()) == peer) { in btif_av_source_initiate_av_open_timer_timeout()
2251 peer->PeerAddress().ToString().c_str()); in btif_av_source_initiate_av_open_timer_timeout()
2252 btif_av_source_dispatch_sm_event(peer->PeerAddress(), in btif_av_source_initiate_av_open_timer_timeout()
2262 BtifAvPeer* peer = (BtifAvPeer*)data; in btif_av_sink_initiate_av_open_timer_timeout() local
2265 peer->PeerAddress().ToString().c_str()); in btif_av_sink_initiate_av_open_timer_timeout()
2268 if (!btif_rc_is_connected_peer(peer->PeerAddress())) { in btif_av_sink_initiate_av_open_timer_timeout()
2270 peer->PeerAddress().ToString().c_str()); in btif_av_sink_initiate_av_open_timer_timeout()
2276 btif_av_sink.FindPeer(peer->PeerAddress()) == peer) { in btif_av_sink_initiate_av_open_timer_timeout()
2278 peer->PeerAddress().ToString().c_str()); in btif_av_sink_initiate_av_open_timer_timeout()
2279 btif_av_sink_dispatch_sm_event(peer->PeerAddress(), in btif_av_sink_initiate_av_open_timer_timeout()
2381 BtifAvPeer* peer = nullptr; in btif_av_handle_event() local
2390 peer = btif_av_source.FindOrCreatePeer(peer_address, bta_handle); in btif_av_handle_event()
2392 peer = btif_av_sink.FindOrCreatePeer(peer_address, bta_handle); in btif_av_handle_event()
2396 peer = btif_av_source.FindPeerByHandle(bta_handle); in btif_av_handle_event()
2398 peer = btif_av_sink.FindPeerByHandle(bta_handle); in btif_av_handle_event()
2401 if (peer == nullptr) { in btif_av_handle_event()
2411 peer->StateMachine().ProcessEvent(btif_av_event.Event(), in btif_av_handle_event()
2571 BtifAvPeer* peer = btif_av_sink_find_peer(btif_av_sink.ActivePeer()); in bta_av_sink_media_callback() local
2572 if (peer != nullptr) { in bta_av_sink_media_callback()
2573 int state = peer->StateMachine().StateId(); in bta_av_sink_media_callback()
2647 BtifAvPeer* peer = nullptr; in connect_int() local
2649 peer = btif_av_source.FindOrCreatePeer(*peer_address, kBtaHandleUnknown); in connect_int()
2650 if (peer == nullptr) { in connect_int()
2654 peer = btif_av_sink.FindOrCreatePeer(*peer_address, kBtaHandleUnknown); in connect_int()
2655 if (peer == nullptr) { in connect_int()
2659 peer->StateMachine().ProcessEvent(BTIF_AV_CONNECT_REQ_EVT, nullptr); in connect_int()
2680 BtifAvPeer* peer = nullptr; in set_active_peer_int() local
2701 (peer == nullptr) ? "found" : "connected"); in set_active_peer_int()
2875 const BtifAvPeer* peer = it.second; in btif_av_stream_stop() local
2876 btif_av_source_dispatch_sm_event(peer->PeerAddress(), in btif_av_stream_stop()
2886 const BtifAvPeer* peer = it.second; in btif_av_stream_suspend() local
2887 btif_av_source_dispatch_sm_event(peer->PeerAddress(), in btif_av_stream_suspend()
2910 BtifAvPeer* peer = btif_av_find_active_peer(); in btif_av_stream_ready() local
2911 if (peer == nullptr) { in btif_av_stream_ready()
2916 int state = peer->StateMachine().StateId(); in btif_av_stream_ready()
2918 peer->PeerAddress().ToString().c_str(), state, in btif_av_stream_ready()
2919 peer->FlagsToString().c_str()); in btif_av_stream_ready()
2921 if (peer->CheckFlags(BtifAvPeer::kFlagRemoteSuspend | in btif_av_stream_ready()
2930 BtifAvPeer* peer = btif_av_find_active_peer(); in btif_av_stream_started_ready() local
2931 if (peer == nullptr) { in btif_av_stream_started_ready()
2936 int state = peer->StateMachine().StateId(); in btif_av_stream_started_ready()
2938 if (peer->CheckFlags(BtifAvPeer::kFlagLocalSuspendPending | in btif_av_stream_started_ready()
2947 peer->PeerAddress().ToString().c_str(), state, in btif_av_stream_started_ready()
2948 peer->FlagsToString().c_str(), ready); in btif_av_stream_started_ready()
3050 BtifAvPeer* peer = btif_av_find_active_peer(); in btif_av_is_connected() local
3051 if (peer == nullptr) { in btif_av_is_connected()
3056 bool connected = peer->IsConnected(); in btif_av_is_connected()
3058 peer->PeerAddress().ToString().c_str(), in btif_av_is_connected()
3064 BtifAvPeer* peer = btif_av_find_active_peer(); in btif_av_get_peer_sep() local
3065 if (peer == nullptr) { in btif_av_get_peer_sep()
3070 uint8_t peer_sep = peer->PeerSep(); in btif_av_get_peer_sep()
3072 peer->PeerAddress().ToString().c_str(), in btif_av_get_peer_sep()
3078 BtifAvPeer* peer = btif_av_find_active_peer(); in btif_av_clear_remote_suspend_flag() local
3079 if (peer == nullptr) { in btif_av_clear_remote_suspend_flag()
3085 peer->PeerAddress().ToString().c_str(), in btif_av_clear_remote_suspend_flag()
3086 peer->FlagsToString().c_str()); in btif_av_clear_remote_suspend_flag()
3087 peer->ClearFlags(BtifAvPeer::kFlagRemoteSuspend); in btif_av_clear_remote_suspend_flag()
3091 BtifAvPeer* peer = btif_av_find_peer(peer_address); in btif_av_is_peer_edr() local
3092 if (peer == nullptr) { in btif_av_is_peer_edr()
3097 if (!peer->IsConnected()) { in btif_av_is_peer_edr()
3103 bool is_edr = peer->IsEdr(); in btif_av_is_peer_edr()
3110 BtifAvPeer* peer = btif_av_find_peer(peer_address); in btif_av_peer_supports_3mbps() local
3111 if (peer == nullptr) { in btif_av_peer_supports_3mbps()
3117 bool is3mbps = peer->Is3Mbps(); in btif_av_peer_supports_3mbps()
3118 bool is_connected = peer->IsConnected(); in btif_av_peer_supports_3mbps()
3136 static void btif_debug_av_peer_dump(int fd, const BtifAvPeer& peer) { in btif_debug_av_peer_dump() argument
3138 int state = peer.StateMachine().StateId(); in btif_debug_av_peer_dump()
3160 dprintf(fd, " Peer: %s\n", peer.PeerAddress().ToString().c_str()); in btif_debug_av_peer_dump()
3161 dprintf(fd, " Connected: %s\n", peer.IsConnected() ? "true" : "false"); in btif_debug_av_peer_dump()
3162 dprintf(fd, " Streaming: %s\n", peer.IsStreaming() ? "true" : "false"); in btif_debug_av_peer_dump()
3163 dprintf(fd, " SEP: %d(%s)\n", peer.PeerSep(), in btif_debug_av_peer_dump()
3164 (peer.IsSource()) ? "Source" : "Sink"); in btif_debug_av_peer_dump()
3166 dprintf(fd, " Flags: %s\n", peer.FlagsToString().c_str()); in btif_debug_av_peer_dump()
3168 alarm_is_scheduled(peer.AvOpenOnRcTimer()) ? "Scheduled" in btif_debug_av_peer_dump()
3170 dprintf(fd, " BTA Handle: 0x%x\n", peer.BtaHandle()); in btif_debug_av_peer_dump()
3171 dprintf(fd, " Peer ID: %d\n", peer.PeerId()); in btif_debug_av_peer_dump()
3172 dprintf(fd, " EDR: %s\n", peer.IsEdr() ? "true" : "false"); in btif_debug_av_peer_dump()
3173 dprintf(fd, " Support 3Mbps: %s\n", peer.Is3Mbps() ? "true" : "false"); in btif_debug_av_peer_dump()
3175 peer.SelfInitiatedConnection() ? "true" : "false"); in btif_debug_av_peer_dump()
3186 const BtifAvPeer* peer = it.second; in btif_debug_av_source_dump() local
3187 btif_debug_av_peer_dump(fd, *peer); in btif_debug_av_source_dump()
3200 const BtifAvPeer* peer = it.second; in btif_debug_av_sink_dump() local
3201 btif_debug_av_peer_dump(fd, *peer); in btif_debug_av_sink_dump()