-
Notifications
You must be signed in to change notification settings - Fork 311
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
Release/v0.7.0 #232
Merged
Merged
Release/v0.7.0 #232
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pin bump2version to latest version 1.0.0
Pin pyobjc to latest version 6.2
The _central_manager_delegate_ready task doesn't appear to do anything useful (not used by anything) and it may never finish which can cause an error when an application exits. Task was destroyed but it is pending! task: <Task pending name='Task-2' coro=<Application._central_manager_delegate_ready() running at bleak/backends/corebluetooth/__init__.py:46>>
This replaces hard-coded numbers with constants from objc bindings
core bluetooth has to wait until centralManagerDidUpdateState_ is called and the state is CBManagerStatePoweredOn before any other bluetooth functions can be used. Since __init__ can't be async, this means we have to move the check to the other async entry points of discovery and scanner.
Apparently some things were removed from the CentralManagerDelegate that kept track of scanned peripherals. This replaces it with a new implementation in BleakScannerCoreBluetooth instead.
This replaces the NSRunLoop integration in the corebluetooth backend with a dispatch queue. This causes callbacks to be dispatched on a background thread instead of on the main dispatch queue on the main thread. `call_soon_threadsafe()` is used to synchronize the events with the event loop where the central manager was created. The NSRunLoop caused problems because it had to manually be called from the main thread. This left an asyncio task that had to be manually stopped at the end of a program to prevent errors about the still running task (issue: #111). The NSRunLoop implementation was also not very efficient since it was waking up the event loop every millisecond to check for events.
This removes the global Application() class in the corebluetooth backend. Instead, a new central manager is created for each scanner object. Since an instance of the `Application()` was created on module import, it could interfere with other code like introspection tools that don't actually want to run `bleak`. This also fixes running `bleak` in threads (#206).
The pyobjc package requires in all pyobjc-* packages, most of which we don't use. This fixes the requirements so that we only install the packages we are using.
CoreBluetooth fixes
…cteristic UUID. Fix ssue #139.
TODO modified.
Difference in availability of handles in BlueZ < 5.51.
Merges #167 by means of new branch. Changed some details of #167 to handle characteristics a bit differently. read_gatt_char, write_gatt_char, start_notify and stop_notify now accepts: - BleakGATTCharacteristics objects - integer handle for the characteristic to use - string uuid - uuid.UUID objects The efficiency of using the different solutions are in that descending order as well. It is now less effective than before to use string representations of the UUIDs of a characteristic, this is an effect of keeping track of characteristics is done by integer handles instead of string uuids. This will hopefully fixes #139 and #159.
Updated documentation about scanning filters. Added scanning filters to .NET discover method. Updated CHANGLOG.
Add David Lechner as contributor
Some changes in CONTRIBUTING.rst as well
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
asyncio
Problems related to asyncio and multiple clients
Backend: BlueZ
Issues and PRs relating to the BlueZ backend
Backend: Core Bluetooth
Issues and PRs relating to the Core Bluetooth backend
Backend: pythonnet
Issues or PRs relating to the .NET/pythonnet backend
bug
Something isn't working
dependencies
Pull requests that update a dependency file
Documentation
Issues or PRs relating to RTD or documentation
enhancement
New feature or request
scanning
Issues about scanning/discovery
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Version 0.7.0 (2020-06-30)
Added
Scanner
implemented.service_explorer.py
.discover
method.Changed
NSRunLoop
with dispatch queue in Core Bluetooth backend. This causes callbacks to be dispatched on a background thread instead of on the main dispatch queue on the main thread.call_soon_threadsafe()
is used to synchronize the events with the event loop where the central manager was created. Fixes Bleak CoreBluetooth backend is leaking tasks? #111.BleakClient
andBleakScanner
. Fixes MacOS: scanning in new thread raises BleakError("Bluetooth device is turned off") #206 and Problem with connecting to a few devices #105.requirements.txt
andPipfile
, the requirement onpythonnet
was bumped to version 2.5.1, which seems to solve issues described in Fix app crash on Windows when receiving approx 300 bytes #217 and Fix app crash on Windows when receiving approx 300 bytes #225.HISTORY.rst
toCHANGELOG.rst
and adopted theKeep a Changelog <https://keepachangelog.com/en/1.0.0/>
_ format.pyobjc
dependencies to use at least version 6.2. (PR Pin pyobjc to latest version 6.2 #194)bump2version
to version 1.0.0.pyup.yml
for PyupRemoved
_central_manager_delegate_ready
was removed in macOS backend.bleak.backends.bluez.utils.get_gatt_service_path
method. It is not used bybleak and possibly generates errors.
Fixed
get_device_object_path
method. Now, we try to get it from BlueZ first. Otherwise, use the old fallback.CBManagerStatePoweredOn
is now properly handled in Core Bluetooth.discover
andScanner
corrected. Fixes Unable to run scan example: 'CentralManagerDelegate' object has no attribute 'peripherals' #211