3

I need to know how to expose multiple interfaces in a same object path under a service using QDbus bindings in the dbus server. I use qdbusxml2cpp to generate the adaptor classes. The structure below could make the question clear.

MyService (Service Name)
/org/demo (Object path)
org.demo.interface1 (Adaptor classA)
methodA
signalA
org.demo.interface2 (Adaptor classB)
methodB
signalB

Please help me by giving the example code if possible.

BЈовић
  • 62,405
  • 41
  • 173
  • 273

1 Answers1

0

I just spent the last few hours fighting with this myself. Here it is how to do it:

  1. class MyService : public QObject, public QDBusContext has private members `m_interface1' and 'm_interface2'
  2. the interface1 and interface2 classes are derived from the QDBusAbstractAdaptor (derived) class
  3. when instantiating interface1 and interface2 use as parent MyService pointer for them
  4. register MyService pointer to D-Bus using QDBusConnection::registerObject("/", myService)
mBardos
  • 2,872
  • 1
  • 19
  • 16