Check Bluetooth power state
Taken from http://cocoadev.com/wiki/FindingBluetoothAvailability Conflicts: src/io_mac.m
This commit is contained in:
committed by
Lysann Schlegel
parent
f6bbdb199d
commit
ae001a43b3
@@ -68,11 +68,18 @@
|
|||||||
- (id) initWithMemory:(wiimote**)wiimotes_ maxDevices:(int)maxDevices_ timeout:(int)timeout_ {
|
- (id) initWithMemory:(wiimote**)wiimotes_ maxDevices:(int)maxDevices_ timeout:(int)timeout_ {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if(self) {
|
if(self) {
|
||||||
wiimotes = wiimotes_;
|
if (![IOBluetoothHostController defaultController] ||
|
||||||
maxDevices = maxDevices_;
|
[IOBluetoothHostController defaultController].powerState == kBluetoothHCIPowerStateOFF)
|
||||||
timeout = timeout_;
|
{
|
||||||
|
WIIUSE_DEBUG("Bluetooth hardware not available.");
|
||||||
_running = NO;
|
[self release];
|
||||||
|
self = nil;
|
||||||
|
} else {
|
||||||
|
wiimotes = wiimotes_;
|
||||||
|
maxDevices = maxDevices_;
|
||||||
|
timeout = timeout_;
|
||||||
|
_running = NO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user