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

Osc*_*ald 4 macos cocoa bluetooth objective-c iobluetooth

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

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

LaC*_*LaC 6

[[IOBluetoothHostController defaultController] addressAsString]
Run Code Online (Sandbox Code Playgroud)

或者getAddress:如果你想要一个BluetoothDeviceAddress.