I am working with the core bluetooth framework . I want set my mac mini which is BLE enable device as a bluetooth peripheral which advertise the data . I have tried to create mac application for the same : My application implements CBPeripheralDelegate protocol and in view didDidLoad method i have implemented following code :
peripheralManager=[[CBPeripheral alloc]init];
peripheralManager.delegate=self;
But its not working . Is this sufficient ? Or really OSx application supports the peripheral mode ?
You are initializing CBPeripheral in your code not CBPeripheralManager.
Here's an example from a project I'm working on:
//Initializes peripheral manager
-(CBPeripheralManager *)peripheralManager
{
if (_peripheralManager == nil)
{
_peripheralManager = [[CBPeripheralManager alloc]initWithDelegate:self queue:nil];
}
return _peripheralManager;
}
OS X currently doesn't support peripheral mode -- only central. iOS, however, can act as either a peripheral or a central.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.