Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on macOS High Sierra #58

Open
ziflex opened this Issue Sep 28, 2017 · 15 comments

Comments

Projects
None yet
4 participants
@ziflex
Copy link

ziflex commented Sep 28, 2017

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:

Unhandled event: xpc.Dict{"kCBMsgId":4, "kCBMsgArgs":xpc.Dict{"kCBMsgArgState":5}}
@Scapal

This comment has been minimized.

Copy link

Scapal commented Sep 29, 2017

Same here

@ziflex

This comment has been minimized.

Copy link
Author

ziflex commented Sep 29, 2017

Same in Noble

noble/noble#679

@ziflex

This comment has been minimized.

Copy link
Author

ziflex commented Sep 29, 2017

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.

@ziflex

This comment has been minimized.

Copy link
Author

ziflex commented Sep 29, 2017

And therefore state event changed from 6 to 4

https://github.com/currantlabs/ble/blob/master/darwin/device.go#L19

@ziflex

This comment has been minimized.

Copy link
Author

ziflex commented Sep 29, 2017

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.

@bennesp

This comment has been minimized.

Copy link

bennesp commented Oct 10, 2017

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?

@deadprogram

This comment has been minimized.

Copy link
Contributor

deadprogram commented Oct 27, 2017

This PR from Noble appears to have added the new XPC API calls needed for High Sierra:

noble/noble#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?

@deadprogram

This comment has been minimized.

Copy link
Contributor

deadprogram commented Oct 28, 2017

I just submitted a PR go-ble#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.

@deadprogram

This comment has been minimized.

Copy link
Contributor

deadprogram commented Nov 15, 2017

For anyone interested, please check out go-ble#3

@ziflex

This comment has been minimized.

Copy link
Author

ziflex commented Nov 15, 2017

@deadprogram I will try to test it this week.

@ziflex

This comment has been minimized.

Copy link
Author

ziflex commented Nov 29, 2017

@deadprogram did you guys change public API?

@ziflex

This comment has been minimized.

Copy link
Author

ziflex commented Nov 29, 2017

@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.

@deadprogram

This comment has been minimized.

Copy link
Contributor

deadprogram commented Nov 29, 2017

@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?

@ziflex

This comment has been minimized.

Copy link
Author

ziflex commented Nov 29, 2017

@deadprogram Ok, I will try to move to it and see how it works on High Sierra.

@ziflex

This comment has been minimized.

Copy link
Author

ziflex commented Nov 30, 2017

@deadprogram it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.