I’m trying to send/receive data between iOS and OSX via Bluetooth.
Because GameKit doesn’t support OSX, I need to use other options.
iPhone4S and latest Mac Book Air support Bluetooth 4.0,
so I think it is possible to establish a connection between these devices.
But my sample codes below doesn’t work and need your help.
Though I just create CBCentralManager and start to scan devices(having two iPhone4S and MBA at hand),
– centralManager:didDiscoverPeripheral:advertisementData:RSSI: is never called…
- (void)start {
self.mgr = [[[CBCentralManager alloc] initWithDelegate:self queue:nil] autorelease];
NSDictionary * opts = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], CBCentralManagerScanOptionAllowDuplicatesKey, nil];
[self.mgr scanForPeripheralsWithServices:nil options:opts];
}
- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
{
// not called this delegate method...
}
What’s wrong with my code? Am I missing something?
No, im afraid CoreBluetooth is only for Low Energy devices (watches, health monitors etc…)
It is not possible to connect two Low Energy “Host” devices together using this Bluetooth Profile.