mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-10 22:49:00 +01:00
Add mac support for balance board.
This commit is contained in:
parent
fccf377180
commit
0b869cf12d
@ -116,22 +116,21 @@ WiimoteScanner::~WiimoteScanner()
|
|||||||
void WiimoteScanner::Update()
|
void WiimoteScanner::Update()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
std::vector<Wiimote*> WiimoteScanner::FindWiimotes()
|
void WiimoteScanner::FindWiimotes(std::vector<Wiimote*> & found_wiimotes, Wiimote* & found_board)
|
||||||
{
|
{
|
||||||
// TODO: find the device in the constructor and save it for later
|
// TODO: find the device in the constructor and save it for later
|
||||||
|
|
||||||
std::vector<Wiimote*> wiimotes;
|
|
||||||
IOBluetoothHostController *bth;
|
IOBluetoothHostController *bth;
|
||||||
IOBluetoothDeviceInquiry *bti;
|
IOBluetoothDeviceInquiry *bti;
|
||||||
SearchBT *sbt;
|
SearchBT *sbt;
|
||||||
NSEnumerator *en;
|
NSEnumerator *en;
|
||||||
|
found_board = NULL;
|
||||||
|
|
||||||
bth = [[IOBluetoothHostController alloc] init];
|
bth = [[IOBluetoothHostController alloc] init];
|
||||||
if ([bth addressAsString] == nil)
|
if ([bth addressAsString] == nil)
|
||||||
{
|
{
|
||||||
WARN_LOG(WIIMOTE, "No bluetooth host controller");
|
WARN_LOG(WIIMOTE, "No bluetooth host controller");
|
||||||
[bth release];
|
[bth release];
|
||||||
return wiimotes;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sbt = [[SearchBT alloc] init];
|
sbt = [[SearchBT alloc] init];
|
||||||
@ -162,14 +161,22 @@ std::vector<Wiimote*> WiimoteScanner::FindWiimotes()
|
|||||||
|
|
||||||
Wiimote *wm = new Wiimote();
|
Wiimote *wm = new Wiimote();
|
||||||
wm->btd = dev;
|
wm->btd = dev;
|
||||||
wiimotes.push_back(wm);
|
|
||||||
|
if(IsBalanceBoardName(name))
|
||||||
|
{
|
||||||
|
found_board = wm;
|
||||||
|
NOTICE_LOG(WIIMOTE, "Found balance board (%s).", bdaddr_str);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
found_wiimotes.push_back(wm);
|
||||||
|
NOTICE_LOG(WIIMOTE, "Found wiimote (%s).", bdaddr_str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[bth release];
|
[bth release];
|
||||||
[bti release];
|
[bti release];
|
||||||
[sbt release];
|
[sbt release];
|
||||||
|
|
||||||
return wiimotes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WiimoteScanner::IsReady() const
|
bool WiimoteScanner::IsReady() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user