I am using Core Bluetooth Framework in my app.
I know how to scan for peripherals and getting values from it.(like Heart Rate Monitor)
But what I want is to retrieve the surrounding iPhone Devices list that supports BLE 4.0 and Bluetooth Enabled ones.
I referred below links..
Uses CoreBluetooth For Getting Peripherals not the Devices List
- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI {
// I'm not sure how to make this work
NSLog (@"Discovered peripheral: %@", [peripheral name]);
[self.list addObject:peripheral.name]; // add peripheral name to foundarray
NSLog (@"UUID peripheral: %@", [peripheral UUID]);
NSLog (@"peripheral services before connected: %@", [peripheral services]);
NSLog(@"adversting data %@",[NSString stringWithFormat:@"%@",[advertisementData description]]);
NSLog(@"foundArray is %@", self.list);
}
- (void)centralManagerDidUpdateState:(CBCentralManager *)central {
NSLog(@"Central manager's state is updated to: %@", central);
if(central.state == CBCentralManagerStatePoweredOn)
{
//okay your good to go and can now scan
}
else
{
//Unable to use CentralManager methods so print out the central.state and find out why
}
}
I dont know whether Apple provides this or not..
Any Suggestions or Ideas will be appreciated..
Thank In Advance..
CBCentralManagerStateUnsupported
). – Larme