Getting a list of available bluetooth devices in ios

Is there a way to get a list of MAC addresses of available bluetooth devices in ios? I am working on a program that finds people nearby using mac bluetooth addresses.

+2
source share
2 answers

I am sure you have:

[centralManager scanForPeripheralsWithServices:nil options:nil]; 

This means that your application is looking for BLE peripherals.

Every time your application detects that a peripheral application calls:

 - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI 

You can add each detected peripheral to NSArray CBPeripheral

+1
source

This is usually not possible since iOS does not reveal the Bluetooth address in the application.

If you use peripherals other than iOS, you can manually enable BD_ADDR in the "Seller Information" field of advertising data. iOS provides this manufacturer information, and you can get BD_ADDR from there.

For many use cases, the UUID created by iOS for each device is sufficient. If you could provide more detailed information (perhaps in a subsequent question), there may be a good chance that you can find a solution that does not need this workaround.

+1
source

All Articles