mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-23 01:29:19 +01:00
Use bdaddr to compare L2CapWiimote
s
This commit is contained in:
parent
75b5d28540
commit
873b6285b9
@ -16,8 +16,8 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
L2CapWiimote::L2CapWiimote(int recvFd,int sendFd)
|
||||
: m_recvFd(recvFd), m_sendFd(sendFd)
|
||||
L2CapWiimote::L2CapWiimote(int recvFd,int sendFd, bdaddr_t addr)
|
||||
: m_recvFd(recvFd), m_sendFd(sendFd), m_addr(addr)
|
||||
{
|
||||
|
||||
}
|
||||
@ -83,7 +83,7 @@ std::vector<WiimoteDevicePtr> L2CapWiimote::get_devices()
|
||||
continue;
|
||||
}
|
||||
|
||||
outDevices.emplace_back(std::make_shared<L2CapWiimote>(sendFd, recvFd));
|
||||
outDevices.emplace_back(std::make_shared<L2CapWiimote>(sendFd, recvFd, addr));
|
||||
}
|
||||
return outDevices;
|
||||
}
|
||||
@ -117,5 +117,5 @@ bool L2CapWiimote::operator==(const WiimoteDevice& rhs) const
|
||||
auto mote = dynamic_cast<const L2CapWiimote*>(&rhs);
|
||||
if (!mote)
|
||||
return false;
|
||||
return m_recvFd == mote->m_recvFd || m_recvFd == mote->m_sendFd;
|
||||
return bacmp(&m_addr, &mote->m_addr) == 0;
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
class L2CapWiimote : public WiimoteDevice
|
||||
{
|
||||
public:
|
||||
L2CapWiimote(int recvFd, int sendFd);
|
||||
L2CapWiimote(int recvFd, int sendFd, bdaddr_t addr);
|
||||
~L2CapWiimote() override;
|
||||
|
||||
bool write_data(const std::vector<uint8>& data) override;
|
||||
@ -17,5 +17,6 @@ class L2CapWiimote : public WiimoteDevice
|
||||
private:
|
||||
int m_recvFd;
|
||||
int m_sendFd;
|
||||
bdaddr_t m_addr;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user