Problems with D-Bus in Java

Thiago Macieira thiago at kde.org
Thu May 6 06:10:54 PDT 2010


Em Quinta-feira 06 Maio 2010, às 14:05:35, Matthew Johnson escreveu:
> You will have to create your own interface extending DBusInterface for
> anything to work, that is required. I would also like to see the
> introspection data that the QT program is exporting (call
> org.freedesktop.DBus.Introspectable.Introspect on it) because it's not
> clear to me what the interface name should be (com.andago.com doesn't seem
> likely)

$ cat > /tmp/test.h
class Dmanager: public QObject
{
    Q_OBJECT
    Agent *ag;
    Measure *medida;

public:
    Dmanager();

public slots:
  Q_SCRIPTABLE QString getAgent();
  Q_SCRIPTABLE QString getCurrentMeasure();
  Q_SCRIPTABLE QString setAgent(int phd, QString syst, QString manuf,
QString model);
  Q_SCRIPTABLE QString deleteAgent();
  Q_SCRIPTABLE QString setMeasure(QString att, QString val, QString un);
};

$ qdbuscpp2xml /tmp/test.h
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" 
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <interface name="local.Dmanager">
    <method name="getAgent">
      <arg type="s" direction="out"/>
    </method>
    <method name="getCurrentMeasure">
      <arg type="s" direction="out"/>
    </method>
    <method name="setAgent">
      <arg type="s" direction="out"/>
      <arg name="phd" type="i" direction="in"/>
      <arg name="syst" type="s" direction="in"/>
      <arg name="manuf" type="s" direction="in"/>
      <arg name="model" type="s" direction="in"/>
    </method>
    <method name="deleteAgent">
      <arg type="s" direction="out"/>
    </method>
    <method name="setMeasure">
      <arg type="s" direction="out"/>
      <arg name="att" type="s" direction="in"/>
      <arg name="val" type="s" direction="in"/>
      <arg name="un" type="s" direction="in"/>
    </method>
  </interface>
</node>

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100506/1990f96e/attachment.pgp>


More information about the dbus mailing list