mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-07 07:21:18 +12:00
Allow WiimoteControllerProvider
to receive L2CapWiimote
s
This commit is contained in:
parent
32cb2bf3b5
commit
e5d1d0e649
4 changed files with 19 additions and 6 deletions
|
@ -2,7 +2,7 @@
|
|||
#include <bluetooth/l2cap.h>
|
||||
|
||||
namespace {
|
||||
// TODO: Add procedure to get addresses. Should add to PairingDialog
|
||||
// TODO: Get addresses upon user request via PairingDialog
|
||||
std::vector<bdaddr_t> s_address;
|
||||
std::mutex s_addressMutex;
|
||||
|
||||
|
@ -39,6 +39,12 @@ L2CapWiimote::~L2CapWiimote()
|
|||
::close(m_sendFd);
|
||||
}
|
||||
|
||||
void L2CapWiimote::AddCandidateAddresses(const std::vector<bdaddr_t>& addrs)
|
||||
{
|
||||
std::scoped_lock lock(s_addressMutex);
|
||||
std::ranges::copy(addrs, std::back_inserter(s_address));
|
||||
}
|
||||
|
||||
std::vector<WiimoteDevicePtr> L2CapWiimote::get_devices()
|
||||
{
|
||||
s_addressMutex.lock();
|
||||
|
@ -123,5 +129,4 @@ bool L2CapWiimote::operator==(WiimoteDevice& rhs) const
|
|||
if (!mote)
|
||||
return false;
|
||||
return m_recvFd == mote->m_recvFd || m_recvFd == mote->m_sendFd;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue