-
Notifications
You must be signed in to change notification settings - Fork 24
Various improvements to the Bluetooth Low Energy device model and its GATT layer #309
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
Open
virtualabs
wants to merge
56
commits into
main
Choose a base branch
from
bugfix/ble-gatt-missing-desc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
…ic `CharacteristicDescriptor` implementation.
… from a characteristic object.
… previous test and left as-is).
…TT services, characteristics and descriptors. Instead of duplicating a lot of code as done previously, we opted out another architecture. Our previous implementation provided new classes to access a device's GATT server's services, characteristics and descriptors that differed from the ones defined in `whad.ble.profile.characteristic` and `whad.ble.profile.service`, causing some inconsistencies and more bugs due to duplicated code. Instead, we decided to implement each specific type of attribute (service, characteristic, characteristic value, descriptor) as a class that derives indirectly from our base `Attribute` class, allowing them to be managed by our `GenericProfile` class as generic attributes. These classes, however, also inherit from a new `RemoteAttribute` class that acts as an interface between the *model* (our base classes for the different types of attributes) and an existing *GATT* connection, allowing to read and write from/into the remote GATT server's attributes by simply calling standardized method exposed by the `RemoteAttribute` class. These methods drive the underlying BLE stack to initiate a corresponding GATT procedure. Doing so keeps our classes consistent: user can query these classes as if they were standard classes representing a service, a characteristic or a descriptor, and by the way use them directly as a transparent way to interact with the remote server.
…rvice's handle to be incorrect.
…itten into the attribute's model value.
…ovide an easier way to access services and characteristics. - New method `service()` in `PeripheralDevice` retrieves a `PeripheralService` object from its UUID - New method `char()` in `PeripheralService` retrieves a `PeripheralCharacteristic` object from its UUID - `PeripheralService` and `PeripheralDevice` now supports the `in` operator to check for supported service or characteristic - Integration tests for BLE central have been updated to test these new accessors - Documentation has been updated to reflect these changes.
…or `UUID` objects. Added more integration tests. Updated doc.
…es, characteristics and descriptors.
…ose defined in `PeripheralDevice`.
…a lot of different submodules.
…ed UUID as a default property.
…TT profile, services and characteristics classes.
…se a Read request instead of a ReadBlob request)
… mechanism for standard services.
…it is done with `PeripheralService`.
…nd `HeartRateService`.
…y discovered services and characteristics.
…connection during GATT profile discovery.
… new method to discover characteristic by uuid and fixed service discovery by uuid.
…haracteristic read from UUID and service discovery from UUID.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WHAD's BLE device model has been refactored to avoid having different classes to model a GATT characteristic or service and access attributes once a connection has been established with a remote GATT server. Many unexpected bugs have been identified and fixed during this refactoring, and more unit and integration tests have been added to detect as much regressions as possible.
This refactoring introduces:
StandardServiceandPeripheralDevice.query()to get an idea)Documentation has been updated accordingly, as well as unit and integration tests.