Skip to content
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

Receive arbitrary signals #39

Closed
rm5248 opened this issue Jan 28, 2019 · 3 comments
Closed

Receive arbitrary signals #39

rm5248 opened this issue Jan 28, 2019 · 3 comments

Comments

@rm5248
Copy link
Contributor

rm5248 commented Jan 28, 2019

For a project that I'm working on, I need to have the ability to listen to arbitrary signals on the bus. A few years ago, I patched dbus-java(2.7) to give it this capability. I just tried with the current version of dbus-java and it won't work correctly, due to how signals work(you need to create a class in the correct package for it to be called correctly). Two questions with this:

  1. Does this make sense as a feature to add? It's needed for my case, but I don't know if it makes sense to add to the library. Most other dbus implementations do provide a way to listen to arbitrary signals.
  2. Assuming it makes sense, the way that I implemented it before was to add in AbstractConnection a new variable for the custom signals, the same type as handledSignals and then looks at these custom handlers after looking at the normal(typed) handlers.

I can do the implementation, I just wanted to get feedback before I started on this.

@hypfvieh
Copy link
Owner

Sounds good to me. I think this feature maybe useful for other cases as well.
If you do the implementation and send a PR, I'll take a look and merge it afterwards.

@hypfvieh
Copy link
Owner

hypfvieh commented Feb 5, 2019

Thanks for your PR. I cleaned it up a bit and merged it.

I also removed the sendSignal method, as this method is a copy of sendMessage.
Instead I updated the javadoc of sendMessage (renaming this method would break the compatibility with older code).
I don't think we should add more methods to the AbstractConnection class if not necessary.

@rm5248
Copy link
Contributor Author

rm5248 commented Feb 5, 2019

That all looks good to me. I will continue to test it out on my end to ensure that everything is working appropriately.

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

No branches or pull requests

2 participants