BTEmu: Make m_WiiMotes private

We can already utilize the public interface to access the necessary
instance without exposing a private data member.
This commit is contained in:
Lioncash 2018-06-20 15:10:01 -04:00
parent bdfc6de9fd
commit 2b60fe684c
2 changed files with 4 additions and 3 deletions

View File

@ -57,13 +57,14 @@ public:
bool RemoteDisconnect(u16 _connectionHandle);
std::vector<WiimoteDevice> m_WiiMotes;
WiimoteDevice* AccessWiiMote(const bdaddr_t& _rAddr);
WiimoteDevice* AccessWiiMote(u16 _ConnectionHandle);
void DoState(PointerWrap& p) override;
private:
std::vector<WiimoteDevice> m_WiiMotes;
bdaddr_t m_ControllerBD{{0x11, 0x02, 0x19, 0x79, 0x00, 0xff}};
// this is used to trigger connecting via ACL

View File

@ -915,7 +915,7 @@ void WiimoteDevice::ReceiveL2capData(u16 scid, const void* data, u32 size)
namespace Core
{
/* This is called continuously from the Wiimote plugin as soon as it has received
a reporting mode. _Size is the byte size of the report. */
a reporting mode. size is the byte size of the report. */
void Callback_WiimoteInterruptChannel(int number, u16 channel_id, const void* opaque_data, u32 size)
{
const u8* data = (const u8*)opaque_data;
@ -928,6 +928,6 @@ void Callback_WiimoteInterruptChannel(int number, u16 channel_id, const void* op
const auto bt = std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>(
IOS::HLE::GetIOS()->GetDeviceByName("/dev/usb/oh1/57e/305"));
if (bt)
bt->m_WiiMotes[number].ReceiveL2capData(channel_id, opaque_data, size);
bt->AccessWiiMote(0x100 + number)->ReceiveL2capData(channel_id, opaque_data, size);
}
}