Futile attempts at fixing OS X.

This commit is contained in:
Jordan Woyak 2013-02-12 21:37:47 -06:00
parent 7f305ba822
commit 77381a1af2

View File

@ -150,6 +150,7 @@ std::vector<Wiimote*> WiimoteScanner::FindWiimotes()
[bti stop];
int found_devices = [[bti foundDevices] count];
if (found_devices)
NOTICE_LOG(WIIMOTE, "Found %i bluetooth devices", found_devices);
en = [[bti foundDevices] objectEnumerator];
@ -180,11 +181,11 @@ bool WiimoteScanner::IsReady() const
// Connect to a wiimote with a known address.
bool Wiimote::Connect()
{
ConnectBT *cbt = [[ConnectBT alloc] init];
if (IsConnected())
return false;
ConnectBT *cbt = [[ConnectBT alloc] init];
[btd openL2CAPChannelSync: &cchan
withPSM: kBluetoothL2CAPPSMHIDControl delegate: cbt];
[btd openL2CAPChannelSync: &ichan
@ -215,6 +216,9 @@ bool Wiimote::Connect()
// Disconnect a wiimote.
void Wiimote::Disconnect()
{
if (!IsConnected())
return;
NOTICE_LOG(WIIMOTE, "Disconnecting wiimote %i", index + 1);
m_connected = false;