bt-manager icon indicating copy to clipboard operation
bt-manager copied to clipboard

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

Open gillg opened this issue 8 years ago • 4 comments

Work not finished yet, to add Bluez5 support.

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

gillg avatar Aug 01 '17 22:08 gillg

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.

liamw9534 avatar Aug 03 '17 08:08 liamw9534

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 avatar Aug 03 '17 18:08 gillg

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 ?

gillg avatar Sep 01 '17 23:09 gillg

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

matbeedotcom avatar Dec 18 '17 05:12 matbeedotcom