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

Implement macOS backend #3

Closed
hbldh opened this issue Apr 27, 2018 · 11 comments
Closed

Implement macOS backend #3

hbldh opened this issue Apr 27, 2018 · 11 comments
Assignees
Labels
Backend: Core Bluetooth Issues and PRs relating to the Core Bluetooth backend enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@hbldh
Copy link
Owner

hbldh commented Apr 27, 2018

Implement CoreBluetooth backend to use for macOS for true cross platform capabilities.

@hbldh hbldh added enhancement New feature or request help wanted Extra attention is needed labels Apr 27, 2018
@hbldh hbldh self-assigned this Apr 27, 2018
@hbldh hbldh added the Backend: Core Bluetooth Issues and PRs relating to the Core Bluetooth backend label Jun 24, 2019
@hbldh hbldh added this to the v0.5.0 milestone Jul 3, 2019
@hbldh
Copy link
Owner Author

hbldh commented Jul 3, 2019

@kevincar Is the replacement of self necessary here? I get it to work without replacing it (I dislike the feeling of overwriting it...), but I want to know if you have more insight into it than me?

@kevincar
Copy link
Contributor

kevincar commented Jul 3, 2019

PyObjC documentation shows an example of creating an objective-c style python class here. I simply followed the examples on that site to avoid any unexplained behavior that may have arisen.

However, I never tested the code without replacing self. So if the code works without replacement, then it sounds like we might be able to remove that.

@hbldh
Copy link
Owner Author

hbldh commented Jul 3, 2019

The discovery timout in connect is pretty high: 10 seconds. Have you assigned it this high just to ensure no device is missed or have you been experiencing problems with lower threshold?

@hbldh
Copy link
Owner Author

hbldh commented Jul 3, 2019

PyObjC documentation shows an example of creating an objective-c style python class here.

I will not argue with the official documentation's advice to rebind self. It stays as it is.

hbldh added a commit that referenced this issue Jul 3, 2019
Rearranging imports
Some logging modifications
Added separate handling of read descriptor data
Fix for stop_notify
Discussed in #3
@hbldh
Copy link
Owner Author

hbldh commented Jul 3, 2019

Made some minor edits during my first testing of it on a Mac mini mid 2011 running OS X 10.11.6. It works very well! Will be testing more tomorrow!

@kevincar
Copy link
Contributor

kevincar commented Jul 3, 2019

The discovery timout in connect is pretty high

If you're referring to this then yes. I set it to 10 seconds to allow timing to find devices.

@kevincar
Copy link
Contributor

kevincar commented Jul 5, 2019

As an update: I previously was utilizing a supplemental framework to get around some issues I was having with assigning delegate objects. With these changes the framework can be removed.

@hbldh
Copy link
Owner Author

hbldh commented Jul 25, 2019

Hello, sorry for leaving this hanging for some time. I have been very strapped for time available for spare time coding lately...

The changes you propose, does that remove the need for the corebleak Xcode project alltogether? The corebleak.framework as well? Or are they still needed?

Does something require any compilation at any stage? I am thinking for building binary wheels on CI system.

@kevincar
Copy link
Contributor

The Xcode project was there to build the corebleak.framework via the makefile in the core bleak folder.

But to answer your question, yes, with these changes, neither the framework nor the Xcode project are necessary.

I had created this framework for assigning values to read-only properties of objective-c objects before realizing that PyObjC already provides setter functions for this purpose.

@hbldh
Copy link
Owner Author

hbldh commented Aug 1, 2019

Integrated kevincar/bleak@a7fa367 into bleak and will merge to master and deploy and 0.5.0 to PyPI tomorrow (I cannot test the new changes on a Mac today, so I want to wait for that).

hbldh added a commit that referenced this issue Aug 2, 2019
Implemented new method stumps (due to abstract methods) from #86 in macOS and Windows backends as well.
Modified example files to show how Core Bluetooth backend handles addresses.
Removed corebleak.py, since I do not think it is needed any more either.
@hbldh
Copy link
Owner Author

hbldh commented Aug 2, 2019

This has now been released in version 0.5.0, which is now available from PyPI. Thank you very much. If you want to, add yourself to the CONTRIBUTORS.rst file and make a PR for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend: Core Bluetooth Issues and PRs relating to the Core Bluetooth backend enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants