Open ziflex opened 7 years ago
Same here
Same in Noble
One of the reasons why it might fail is that Apple switched from com.apple.bluehd
to com.apple.bluetoothd
.
And here https://github.com/currantlabs/ble/blob/master/darwin/device.go#L80
We explicitly connect to com.apple.bluehd
.
And therefore state event changed from 6 to 4
https://github.com/currantlabs/ble/blob/master/darwin/device.go#L19
Ok, I made it work Here are my changes:
evtStateChanged = 4
https://github.com/currantlabs/ble/blob/master/darwin/device.go#L19
d.pm = xpc.XpcConnect("com.apple.bluetoothd", d)
d.cm = xpc.XpcConnect("com.apple.bluetoothd", d)
https://github.com/currantlabs/ble/blob/master/darwin/device.go#L80
I think we could come up with some kind of ConnectionProvider
and EventCodesProvider
which would be selected based on the version of macOS.
I tried with that changes, with and without sudo, and it says
Scanning for 5s...
done
without showing any device (and there are ~320 devices BLE that I can see with the Apple Bluetooth Explorer)
What am I doing wrong?
This PR from Noble appears to have added the new XPC API calls needed for High Sierra:
https://github.com/sandeepmistry/noble/pull/689
The https://github.com/go-ble/ble fork of ble seems like has some work in this area... @moogle19 can you please fill us in on what you are up to, and how we can help?
I just submitted a PR https://github.com/go-ble/ble/pull/2 on the branch that @moogle19 has been working on. It should work on both High Sierra, as well as on El Capitan/Yosemite. Anyone who can help by testing on High Sierra would be most helpful.
For anyone interested, please check out https://github.com/go-ble/ble/issues/3
@deadprogram I will try to test it this week.
@deadprogram did you guys change public API?
@deadprogram and btw, is go-ble
is intended to be a proxy repo for fixes or a completely independent fork ? Wondering, maybe it's better to move to it.
@moogle19 made a change to the API related to Addr
or something like that. Relatively small change.
From what I can tell, it is a more active fork and hence why I have mostly moved to it. I guess it is the new "main" fork?
@deadprogram Ok, I will try to move to it and see how it works on High Sierra.
@deadprogram it works!
Hi there,
I know that macOS High Sierra was released just few days ago, but just wanted to warn those of you who develop on Mac. That's what I'm getting from the lib in console: