mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-26 19:14:18 +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)
|
L2CapWiimote::L2CapWiimote(int recvFd,int sendFd, bdaddr_t addr)
|
||||||
: m_recvFd(recvFd), m_sendFd(sendFd)
|
: m_recvFd(recvFd), m_sendFd(sendFd), m_addr(addr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ std::vector<WiimoteDevicePtr> L2CapWiimote::get_devices()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
outDevices.emplace_back(std::make_shared<L2CapWiimote>(sendFd, recvFd));
|
outDevices.emplace_back(std::make_shared<L2CapWiimote>(sendFd, recvFd, addr));
|
||||||
}
|
}
|
||||||
return outDevices;
|
return outDevices;
|
||||||
}
|
}
|
||||||
@ -117,5 +117,5 @@ bool L2CapWiimote::operator==(const WiimoteDevice& rhs) const
|
|||||||
auto mote = dynamic_cast<const L2CapWiimote*>(&rhs);
|
auto mote = dynamic_cast<const L2CapWiimote*>(&rhs);
|
||||||
if (!mote)
|
if (!mote)
|
||||||
return false;
|
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
|
class L2CapWiimote : public WiimoteDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
L2CapWiimote(int recvFd, int sendFd);
|
L2CapWiimote(int recvFd, int sendFd, bdaddr_t addr);
|
||||||
~L2CapWiimote() override;
|
~L2CapWiimote() override;
|
||||||
|
|
||||||
bool write_data(const std::vector<uint8>& data) override;
|
bool write_data(const std::vector<uint8>& data) override;
|
||||||
@ -17,5 +17,6 @@ class L2CapWiimote : public WiimoteDevice
|
|||||||
private:
|
private:
|
||||||
int m_recvFd;
|
int m_recvFd;
|
||||||
int m_sendFd;
|
int m_sendFd;
|
||||||
|
bdaddr_t m_addr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user