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/v0.7.0 #232

Merged
merged 47 commits into from
Jun 30, 2020
Merged

Release/v0.7.0 #232

merged 47 commits into from
Jun 30, 2020

Conversation

hbldh
Copy link
Owner

@hbldh hbldh commented Jun 30, 2020

Version 0.7.0 (2020-06-30)

Added

  • Better feedback of communication errors to user in .NET backend and implementing error details proposed in client.write_gatt_char() not exposing GATT error code to user #174.
  • Two devices example file to use for e.g. debugging.
  • Detection/discovery callbacks in Core Bluetooth backend Scanner implemented.
  • Characteristic handle printout in service_explorer.py.
  • Added scanning filters to .NET backend's discover method.

Changed

Removed

  • Removed documentation note about not using new event loops in Linux. This was fixed by backends/bluezdbus: use an a new reactor for each client #143.
  • _central_manager_delegate_ready was removed in macOS backend.
  • Removed the bleak.backends.bluez.utils.get_gatt_service_path method. It is not used by
    bleak and possibly generates errors.

Fixed

pyup-bot and others added 30 commits May 15, 2020 14:49
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.
hbldh and others added 10 commits June 30, 2020 12:59
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.
@hbldh hbldh added bug Something isn't working enhancement New feature or request dependencies Pull requests that update a dependency file 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 asyncio Problems related to asyncio and multiple clients scanning Issues about scanning/discovery labels Jun 30, 2020
@hbldh hbldh added this to the Version 0.7.0 milestone Jun 30, 2020
@hbldh hbldh self-assigned this Jun 30, 2020
Some changes in CONTRIBUTING.rst as well
@hbldh hbldh merged commit 5e8f8de into master Jun 30, 2020
@hbldh hbldh deleted the release/v0.7.0 branch August 20, 2020 07:13
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
Projects
None yet
3 participants