Skip to content

Add useful missing interfaces - #8

Merged
igo95862 merged 9 commits into
python-sdbus:masterfrom
perch-fitness:master
Apr 7, 2025
Merged

Add useful missing interfaces#8
igo95862 merged 9 commits into
python-sdbus:masterfrom
perch-fitness:master

Conversation

@jlucier

@jlucier jlucier commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

I'm working with this library to create an RFCOMM server. I'm adding missing interfaces as I'm needing them. Please let me know if there is a better way to create blocking and async interfaces than copying the code (though, that's what I've seen in python-sdbus-networkmanager as well).

I'll continue adding / editing until I have my application fully functional. So far I have:

  • Added ProfileInterfaceAsync to default exports
  • New async AgentInterfaceAsync
  • New blocking AdapterInterface
  • New blocking AgentManagerInterface
  • New blocking ProfileInterface
  • New blocking ProfileManagerInterface

@igo95862

igo95862 commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

Hello @jlucier

Biggest issue is that BlueZ does not provide the D-Bus XML introspection. This means we have to rely on extracting introspection from running Bluez which might not have all interfaces active or write them by hand using documentation which is very time consuming.

@jlucier

jlucier commented Mar 4, 2025

Copy link
Copy Markdown
Contributor Author

@igo95862 I'm writing the ones I need by hand, it's not a problem. I'll mark the PR "ready for review" when I'm finished and I'm confident the interfaces are all working. Hopefully after that it can be merged.

I was wondering if there was a better way to make the same interfaces available for both async and blocking. From what I've seen, there is not and the must simply be re-declared.

@igo95862

igo95862 commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

I was wondering if there was a better way to make the same interfaces available for both async and blocking. From what I've seen, there is not and the must simply be re-declared.

I was experimenting with using ParamSpec and @typing.overload to convert the async interfaces to blocking ones but the issue is that the Python code completion jedi does not support the ParamSpec so the function completion suggestions will stop working.

python-sdbus/python-sdbus#60

@jlucier
jlucier marked this pull request as ready for review March 6, 2025 21:48
@jlucier

jlucier commented Mar 6, 2025

Copy link
Copy Markdown
Contributor Author

@igo95862 I believe I have finished. I have my system working using these new interfaces and believe them all to be correct. This is ready for review and a merge if you see fit. Thanks.

@jlucier

jlucier commented Apr 2, 2025

Copy link
Copy Markdown
Contributor Author

@igo95862 @kawasaki any chance this could be merged?

@igo95862

igo95862 commented Apr 2, 2025

Copy link
Copy Markdown
Contributor

Sorry, I completely forgot about this. I will try to review it soon.

Comment thread sdbus_async/bluez/agent_api.py Outdated
Comment thread sdbus_block/bluez/profile_api.py Outdated
Comment thread sdbus_block/bluez/profile_api.py Outdated
@igo95862

igo95862 commented Apr 2, 2025

Copy link
Copy Markdown
Contributor

I left comment about the issues I identified.

By the way I had an idea to build a parser of the upstream interface documentation: https://raw.githubusercontent.com/bluez/bluez/refs/heads/master/doc/org.bluez.Agent.rst

This way the interfaces won't have to be written by hand.

@jlucier

jlucier commented Apr 4, 2025

Copy link
Copy Markdown
Contributor Author

@igo95862 Should be all resolved now!

Comment thread sdbus_async/bluez/agent_api.py Outdated

@igo95862 igo95862 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing return type hints in sdbus_async/bluez/agent_api.py.

@igo95862
igo95862 merged commit 131ccb6 into python-sdbus:master Apr 7, 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.

2 participants