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

Release/0.11.0 #486

Merged
merged 69 commits into from
Mar 18, 2021
Merged

Release/0.11.0 #486

merged 69 commits into from
Mar 18, 2021

Conversation

hbldh
Copy link
Owner

@hbldh hbldh commented Mar 16, 2021

A release proposal for version 0.11.0.

Comments:

  • I have let the WinRT branch stay outside of this. I would like to add Python 3.9 support for windows, but it is not ready yet; I leave it for 0.12.0
  • Same for the Android backend. It will have to wait.
  • It includes the new BlueZ backend, and I think that will be enough to worry about in this release.
  • It includes the service handles, which I think should be released as soon as possible (even though it relies on some non-documented attributes...)

Changelog

Added

  • Updated dotnet.client.BleakClientDotNet connect method docstring.
  • Added AdvertisementServiceData in BLEDevice in macOS devices
  • Protection levels (encryption) in Windows backend pairing. Solves ProtocolError (Error: 0x0F: Connection Rejected due to Unacceptable BD_ADDR) #405.
  • Philips Hue lamp example script. Relates to ProtocolError (Error: 0x0F: Connection Rejected due to Unacceptable BD_ADDR) #405.
  • Keyword arguments to get_services method on BleakClient.
  • Keyword argument use_cached on .NET backend, to enable uncached reading
    of services, characteristics and descriptors in Windows.
  • Documentation on troubleshooting OS level caches for services.
  • New example added: Async callbacks with a queue and external consumer
  • handle property on BleakGATTService objects
  • service_handle property on BleakGATTCharacteristic objects
  • Added more specific type hints for BleakGATTServiceCollection properties.
  • Added asyncio task to disconnect devices on event loop crash in BlueZ backend.
  • Added filtering on advertisement data callbacks on BlueZ backend so that
    callbacks only occur when advertising data changes like on macOS backend.
  • Added fallback to try org.bluez.Adapter1.ConnectDevice when trying to connect
    a device in BlueZ backend.
  • Added UART service example.

Fixed

Changed

  • Using handles to identify the services. Added handle abstract property to BleakGATTService
    and storing the services by handle instead of UUID.
  • Changed BleakScanner.set_scanning_filter() from async method to normal method.
  • Changed BlueZ backend to use dbus-next instead of txdbus.
  • Changed BleakClient.is_connected from async method to property.
  • Consolidated D-Bus signal debug messages in BlueZ backend.

Removed

  • Removed all __str__ methods from backend service, characteristic and descriptor implementations
    in favour of those in the abstract base classes.

dlech and others added 30 commits December 11, 2020 12:52
…ormal method.

This method doesn't need to be async. If it is not async, we can use it in `__init__()` instead of duplicating the implementation.
…dling

If there is a KeyboardInterupt during this program, the device will not disconnect unless we ensure all pending tasks are allowed to finish.
… backend.

This adds a background task that runs until a device is disconnected.
If the task is cancelled (e.g. because the event loop was stopped with
KeyboardInterrupt) and the event loop was run with asyncio.run(), then
a "Disconnect" message should be send via D-Bus before Python exits.
So far disconnect() method has cleared all services collection, but it
didn't reset client._services_resolved flag. This means that services
were not resolved after reconnecting to the same client.

Just clear client._services_resolved, which will allow to resolve
services properly with each subsequent reconnect.
…kDataWriter.detach_buffer() instead of BleakDataWriter.DetachBuffer()
Pull master back into develop
Dotnet client fixed misspelled detach buffer function
…r-disconnect

bluez: resolve services once again after reconnecting
None of the backends actually require an async operation to know if
a device is still connected, so this can just be a property instead
of an async method.
Currently BlueZ invoke an advertisement data callback every time the
RSSI changes while scanning. This is much more frequent than other
backends. To make things more consistent cross-platform, this adds some
filtering so that we only invoke the callback the first time the device
is seen or when a relevant property changes. This brings the behavior
more inline with the default macOS behavior. (Windows still needs work
to get the same behavior.)

Issue: #394
Sometimes BlueZ will remove a device from the BlueZ object manager
before we connect to it. This adds a fallback to the experimental
org.bluez.Adapter1.ConnectDevice method to try to connect to the device
in this case.
This makes all of the D-Bus signal debug messages the same. This will
also let us see if we are receiving too many signals due to bad filter
settings when calling org.freedesktop.DBus.AddMatch.
In one instance in the BlueZ backend, the wrong object type was
passed as the ``details`` argument.
This fixes an issue in the D-Bus signal handler where the interface
was ignored in "InterfacesAdded" and "InterfacesRemoved" signals.
This was causing services and characteristics to be treated like
devices which lead to property lookup errors.
This will help with troubleshooting.
This fixes a race condition where a "PropertiesChanged" signal is
is received for a device before "GetManagedObjects" has returned when
starting scanning.

Properties received before "GetManagedObjects" are simply discarded.

Issue: #395
dlech and others added 15 commits March 2, 2021 13:39
use proper args and add stack trace level
Needed for Python 3.6. create_task() was introduced in Python 3.7
This removes the call to stop_notify() in the cleanup code path in the
BlueZ backend. This was causing an error message to always be logged
when notifications were enabled and a device was disconnected.

As described in the code comment. This call is not necessary and can be
removed.

Fixes: #472

(No changelog since this bug was introduced in changes since the
previous release)
updating docstring for dotnet.client.BleakClientDotNEt connect method
This removes the call to stop_notify() in the cleanup code path in the
BlueZ backend. This was causing an error message to always be logged
when notifications were enabled and a device was disconnected.

As described in the code comment. This call is not necessary and can be
removed.

Fixes #472
Also fixing erroneous links in previous Changelogs...
@hbldh hbldh added bug Something isn't working enhancement New feature or request Backend: pythonnet Issues or PRs relating to the .NET/pythonnet backend Backend: BlueZ Issues and PRs relating to the BlueZ backend Documentation Issues or PRs relating to RTD or documentation Backend: Core Bluetooth Issues and PRs relating to the Core Bluetooth backend security Issues relating to access restrictions in BLE examples Issues relating to bleak example code labels Mar 16, 2021
@hbldh hbldh self-assigned this Mar 16, 2021
@hbldh hbldh requested a review from dlech March 16, 2021 20:43
Copy link
Collaborator

@dlech dlech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with your comments that this is enough for one release. I had a quick skim through all of the changes and nothing jumped out at me.

@hbldh
Copy link
Owner Author

hbldh commented Mar 16, 2021

Very good, and thank you for the work you put into this one! I will merge it and make the release tomorrow. Once more unto the breach...

@hbldh hbldh merged commit f03d868 into master Mar 18, 2021
@hbldh hbldh deleted the release/0.11.0 branch March 18, 2021 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 Documentation Issues or PRs relating to RTD or documentation enhancement New feature or request examples Issues relating to bleak example code security Issues relating to access restrictions in BLE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet