Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@x42en
Copy link

@x42en x42en commented Oct 15, 2025

This pull request refactors the platform-specific GATT characteristic and service classes for BlueZ DBus, CoreBluetooth, and WinRT backends to use the unified BleakGATTCharacteristic and BleakGATTService base classes from bleak.backends.characteristic and bleak.backends.service. It removes backend-specific Bleak imports and updates the initialization and attribute management for improved compatibility and maintainability. The changes also add or update properties and methods for characteristic/service metadata and descriptor management.

Refactoring for Bleak compatibility and codebase simplification:

  • All backend-specific characteristic classes (BlessGATTCharacteristicBlueZDBus, BlessGATTCharacteristicCoreBluetooth, BlessGATTCharacteristicWinRT) now inherit from the unified BleakGATTCharacteristic instead of backend-specific Bleak classes, and their constructors and init methods are updated to set attributes expected by Bleak. [1] [2] [3]
  • All backend-specific service classes (BlessGATTServiceBlueZDBus, BlessGATTServiceCoreBluetooth) now inherit from the unified BleakGATTService, and their constructors and init methods are updated to set attributes expected by Bleak. [1] [2]

Characteristic and service metadata/property improvements:

  • Added or updated properties for service_uuid, service_handle, handle, properties, descriptors, max_write_without_response_size, description, and uuid to all characteristic classes for consistency and Bleak compatibility. [1] [2] [3]
  • Added or updated properties for description, characteristics, and uuid to service classes, including new methods for adding and retrieving characteristics and descriptors. [1] [2]

Descriptor and characteristic management:

  • Added internal lists and methods to manage descriptors and characteristics (add_descriptor, get_descriptor, add_characteristic, get_characteristic) for both characteristics and services, improving extensibility and backend compatibility. [1] [2] [3] [4]

Initialization and attribute assignment updates:

  • Initialization logic in all characteristic and service classes now sets backend-specific objects and attributes (obj, path, _service_uuid, _handle, _max_write_without_response_size, etc.) directly, removing legacy Bleak-specific initialization and simplifying attribute management. [1] [2] [3] [4] [5]

Removal of legacy and backend-specific Bleak imports:

  • Replaced imports from backend-specific Bleak modules with imports from the unified bleak.backends.characteristic and bleak.backends.service modules, reducing code duplication and improving maintainability. [1] [2] [3] [4] [5]

@x42en
Copy link
Author

x42en commented Oct 15, 2025

Should /close MR #151 and Issue #150

@x42en x42en changed the title Add SUpport for Bleak 1.1.1 Add Support for Bleak 1.1.1 Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant