Closed konqui closed 9 years ago
Just checked, for me it works. What OS X version are you using?
When targeting 10.8 or 10.9 in Xcode, the symbol is undefined.
Could you please check output of nm -oj /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.?.sdk/System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth | egrep 'IOBluetoothPreference(sAvailable|((Get|Set)(ControllerPower|Discoverable)State))'
? For me all functions are there in 10.6, 10.7, 10.8 and 10.9 SDKs.
Ah, yep, you're right. The symbols are indeed there. I was incorrectly linking IOBluetooth.framework -- re-adding IOBluetooth.framework in Build Phases and things are working now. Thanks!
@programmarchy Great! @konqui Could you please check the same thing?
@konqui Please reopen if needed.
@toy I think I might have the same problem.
nm -oj /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth | egrep 'IOBluetoothPreference(sAvailable|((Get|Set)(ControllerPower|Discoverable)State))'
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth: No such file or directory.
There is a file with the same name but .tbd
extension, which contains those names in the grep. make
doesn't seem to link properly on my machine since the discoverable does not change in my bluetooth preferences and it keeps discoverable by my phone.
XCode: Version 9.2 (9C40b) macOS: Version 10.13.3 (17D102)
@toy Sorry for my previous message. I was checking it with the preference pane open, but didn't realise that that's also what turns discoverability on. I just tried it without the preference pane and that turns discoverability on when the pref pane is closed, so it works as expected.
Thanks for the great program!
@vidavidorra It seems at some point binary was removed from the framework in xcode and is now available only in the system, so:
nm -oj /System/Library/Frameworks/IOBluetooth.framework/Versions/Current/IOBluetooth | egrep 'IOBluetoothPreference(sAvailable|((Get|Set)(ControllerPower|Discoverable)State))'
Also starting with some Mac OS X/OS X/macOS version there is no manual switching of discoverability, it is done automatically when Bluetooth preference pane is open and bluetooth is on.
And when checking after your comment if everything works, I've noticed that when discoverability is on due to preference pane been opened, it is not reported by IOBluetoothPreferenceGetDiscoverableState
, though turning on/off discoverability using blueutil can be seen using Bluetooth menu item or through System report. Seems like there is another disconnected interface and it may be worth finding it.
@toy Now you say it, I've indeed noticed that with the pref pane open it didn't get reported as 1
by blueutil -d
.
With the pref pane open I didn't see the discoverability change though. Will check again tomorrow and also in the system report this time. Shall I open a new ticket for these?
@toy Just tested the discoverability in the pref pane and it kept showing discoverability is enabled, regardless of changing the setting using blueutil -d 0
. To me, it seems that opening the pref pane always overrules the setting. And is not reported in the IOBluetoothPreferenceGetDiscoverableState
however, the System Report does show the setting and is updated when opening the pref pane or using blueutil when the prefpane is closed.
I think it is worth noting in the README that the pref pane always overrules the setting made using blueutil and that currently the stated reported by blueutil -d
is faulty when the pref pane is open.
The framework seems to be moved indeed, the grep now successfully returns
| ~ @ Jeroens-MacBook-Pro (jdebruijn)
| => nm -oj /System/Library/Frameworks/IOBluetooth.framework/Versions/Current/IOBluetooth | egrep 'IOBluetoothPreference(sAvailable|((Get|Set)(ControllerPower|Discoverable)State))'
/System/Library/Frameworks/IOBluetooth.framework/Versions/Current/IOBluetooth: _IOBluetoothPreferenceGetControllerPowerState
/System/Library/Frameworks/IOBluetooth.framework/Versions/Current/IOBluetooth: _IOBluetoothPreferenceGetDiscoverableState
/System/Library/Frameworks/IOBluetooth.framework/Versions/Current/IOBluetooth: _IOBluetoothPreferenceSetControllerPowerState
/System/Library/Frameworks/IOBluetooth.framework/Versions/Current/IOBluetooth: _IOBluetoothPreferenceSetDiscoverableState
/System/Library/Frameworks/IOBluetooth.framework/Versions/Current/IOBluetooth: _IOBluetoothPreferencesAvailable
discoverable no longer works, so you can remove it! i don't know if Apple changed something with their bluetooth drivers or so.