[EGD-7077] Don't allow for connecting more than 1 BT device at once We don't have support for multiple connected devices thus we shouldn't allow for this. This commit fixes the issue
2 files changed, 8 insertions(+), 5 deletions(-) M module-bluetooth/Bluetooth/interface/profiles/A2DP/A2DP.cpp M module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp
M module-bluetooth/Bluetooth/interface/profiles/A2DP/A2DP.cpp => module-bluetooth/Bluetooth/interface/profiles/A2DP/A2DP.cpp +4 -3
@@ 574,10 574,11 @@ namespace bluetooth void A2DP::A2DPImpl::connect() { if (!isConnected) { LOG_INFO("Starting playback"); a2dp_source_establish_stream(deviceAddr, &AVRCP::mediaTracker.a2dp_cid); if (isConnected) { disconnect(); } LOG_INFO("Starting playback"); a2dp_source_establish_stream(deviceAddr, &AVRCP::mediaTracker.a2dp_cid); } void A2DP::A2DPImpl::disconnect()
M module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp => module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp +4 -2
@@ 183,6 183,7 @@ namespace bluetooth LOG_DEBUG("RFCOMM disconnected.\n"); sendAudioEvent(audio::EventType::BlutoothHSPDeviceState, audio::Event::DeviceState::Disconnected); } isConnected = false; break; case HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE: if (hsp_subevent_audio_connection_complete_get_status(event) != 0u) { @@ 278,9 279,10 @@ namespace bluetooth void HSP::HSPImpl::connect() { if (!isConnected) { hsp_ag_connect(deviceAddr); if (isConnected) { disconnect(); } hsp_ag_connect(deviceAddr); } void HSP::HSPImpl::disconnect()