ios - 获取 ios 中可用蓝牙设备的列表

标签 ios bluetooth bluetooth-lowenergy core-bluetooth ios-bluetooth

有没有办法获取 ios 中可用蓝牙设备的 MAC 地址列表?我正在开发一个程序,该程序可以使用蓝牙 MAC 地址查找附近的人。

最佳答案

我确信你有:

[centralManager scanForPeripheralsWithServices:nil
                                       options:nil];

这意味着您的应用正在搜索 BLE 外设。

每次您的应用程序发现外围设备调用时:

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

您可以将每个发现的外设添加到 CBPeripheralNSArray

关于ios - 获取 ios 中可用蓝牙设备的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22668689/

相关文章:

c - 想在文件中写入数据。

android - 如何使用 RSSI 改进蓝牙距离测量?

bluetooth-lowenergy - 在没有开发人员指南的情况下连接到 OBD2 蓝牙 LE 设备

ios - ios13表格模式单元格无法识别暗模式更改?

ios - 如何将 FFMpeg 构建为 iOS 框架

iphone - 如何将日期中的年份更改为当前年份?

java - Android 中通过蓝牙发送数据

ios - 无法使用 block 在 UITableViewCell 中设置 UIButton 标题

android - 在BluetoothChat示例中以非同步方式在Bluetooth上写入

ios - 使用 updateValue :forCharacteristic:onSubscribedCentrals on OS X 时蓝牙崩溃