Skip to content

WIP: Add Bluez5 support (see #4), fully Bluez4 retrocompatible.#9

Open
gillg wants to merge 14 commits intoliamw9534:masterfrom
gillg:bluez5
Open

WIP: Add Bluez5 support (see #4), fully Bluez4 retrocompatible.#9
gillg wants to merge 14 commits intoliamw9534:masterfrom
gillg:bluez5

Conversation

@gillg
Copy link
Copy Markdown

@gillg gillg commented Aug 1, 2017

Work not finished yet, to add Bluez5 support.

Basic commands (list-adapters / adapter-get / etc..) already tested and functional

@liamw9534
Copy link
Copy Markdown
Owner

I think it makes sense to put this stuff on a separate branch. Since bluez5 is not retrocompatible with bluez4, and projects may still wish to use bluez4, then a separate branch seems the way to go.

@gillg
Copy link
Copy Markdown
Author

gillg commented Aug 3, 2017

I'm according with you. I need to try to make these changes compatibles with both versions. But if I not succeed a branch bluez5 should be the solution (or an archive branch bluez4 with a tag).

@gillg gillg changed the title WIP: Add Bluez5 support (not retrocompatible with bluez4) WIP: Add Bluez5 support (see #4). Try to be compatible with bluez 4 Aug 5, 2017
@gillg gillg changed the title WIP: Add Bluez5 support (see #4). Try to be compatible with bluez 4 WIP: Add Bluez5 support (see #4), fully Bluez4 retrocompatible. Sep 1, 2017
@gillg
Copy link
Copy Markdown
Author

gillg commented Sep 1, 2017

Hi !

I see the light ! :) After some long tests lot of things work with bluez 4 or 5. I'm not a good python dev, so I don't know unit tests with python, maybe someone could help me to write some scripts.

I made lot of changes... work is at 0% on agent.py (need probably a new class with new method decorators), but 100% for interface / devices / adapter / manager / audio / media is done. Some other things are not yet tested.

I deprecated some methods for bluez5 such as "adapter.create_paired_device". I don't find any equivalent... With bluez5 you should use AgentManager I think (https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/agent-api.txt).

I create a new audio lib dedicated to bluez5, needed to make new decorators.


Now, in my tests, I need some help to resolve a strage Dbus exception.

On a mailoop, I find adapter > register audio source endpoint > pair device if needed > try to connect with sink audio profile.
=> I got a dbus error "Input/Output error". In logs, bluez says it received an empty response for method SelectConfiguration().

If I don't try ton connect, and let mainloop run, I connect my device manually with bluetoothctl, SelectConfiguration() is called on my test program, and all is good...
So I think I have a conflict between connect method and callback SelectConfiguration. App call bluez for connection (blocking call), and bluez call SelectConfiguration on App wich could not respond.
I tried to run endpoint in manloop / in thread and connect device in mainloop / different thred, but nothing works... Have you any idea ?

@matbeedotcom
Copy link
Copy Markdown

Any updates on this PR? Possible to make a Pr for a Bluez5 branch?

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.

3 participants