如何在OS X上获取设备蓝牙地址?

时间:2011-07-12 02:09:52

标签: objective-c cocoa macos bluetooth iobluetooth

我已经查看了IOBluetooth框架的感觉十几次,但我不能为我的生活找到一种方法来检索当前设备的蓝牙设备地址。我编写了一个使用IOBluetoothDeviceInquiry扫描范围内设备的应用程序,但这似乎没有提供进行扫描的设备的地址。

如何以编程方式完成此操作? (无需打开System Profiler)

1 个答案:

答案 0 :(得分:6)

[[IOBluetoothHostController defaultController] addressAsString]
如果您需要getAddress:,请

BluetoothDeviceAddress

相关问题