Fix add gatt by adding new **primary** services#173
Merged
kevincar merged 2 commits intokevincar:masterfrom Jan 22, 2026
Merged
Fix add gatt by adding new **primary** services#173kevincar merged 2 commits intokevincar:masterfrom
kevincar merged 2 commits intokevincar:masterfrom
Conversation
Also refactor the test_server file to reuse the server callbacks definition and common tests on read, write and notify. Signed-off-by: Yoan Dumas <yo_dumas@hotmail.fr>
On Ubuntu with bluez, only the primary services are advertised and exposed on the BLE. Signed-off-by: Yoan Dumas <yo_dumas@hotmail.fr>
Owner
|
@EasyRiderr Thanks for these edits! The edits as you've written are a good workaround for now. I think the underlying issue is the fact that the |
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
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.
The
server.add_gatt()method is expected to add several services to the server, meaning the server is expected to advertise and expose these added services (see #142).As a starting point, this PR refactors the
test/test_server.pyfile to facilitate code reuse and adds anasync def test_server_add_gatt()function to highlight this issue.You can see the test results (before the fix is implemented) attached: trace_before.log. Tests are failing because the second characteristic (and service is not advertised, nor exposed).
On Ubuntu, BlueZ only advertise or expose the
primaryBLE services, so to fix theadd_gattmethod, I've just forced the primary parameter to True, while its default value is False. It fixes the issue #142 as you can see it test results attached:trace_after.log