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_ {
|
||||
self = [super init];
|
||||
if(self) {
|
||||
wiimotes = wiimotes_;
|
||||
maxDevices = maxDevices_;
|
||||
timeout = timeout_;
|
||||
|
||||
_running = NO;
|
||||
if (![IOBluetoothHostController defaultController] ||
|
||||
[IOBluetoothHostController defaultController].powerState == kBluetoothHCIPowerStateOFF)
|
||||
{
|
||||
WIIUSE_DEBUG("Bluetooth hardware not available.");
|
||||
[self release];
|
||||
self = nil;
|
||||
} else {
|
||||
wiimotes = wiimotes_;
|
||||
maxDevices = maxDevices_;
|
||||
timeout = timeout_;
|
||||
_running = NO;
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user