[Gambas-user] D-Bus signals with complex signature

Hans Lehmann hans at gambas-buch.de
Tue Mar 27 12:36:02 CEST 2018


Hello,

obviously all data is automatically converted to the correct D-Bus data 
types. A successful test with the signal signature "sia{si}" suggests 
this assumption. The signal is sent successfully (server) and can be 
completely read out by a client.

' Gambas class file

Inherits DBusObject
Create Static

' Signature: "sia{si}"

Event org_gambas_SignalTXComplex_OVersion_GBVersion(Version As String, 
Month As Integer, c As Collection)


The use of the console program 'dbus monitor' also reinforces this 
assumption:

signal time=1522143681.281018 sender=:1.325 -> destination=(null 
destination) serial=6 path=/OVersion; 
interface=org.gambas.SignalTXComplex.OVersion; member=GBVersion
    string "3.10.0"
    int32 3
    array [
       dict entry(
          string "First"
          variant             int32 1
       )
       dict entry(
          string "Second"
          variant             int32 2
       )
    ]

An introspection provides the following XML document:

<!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="org.freedesktop.DBus.Introspectable">
     <method name="Introspect">
       <arg name="xml_data" type="s" direction="out"/>
     </method>
   </interface>
   <interface name="org.freedesktop.DBus.Peer">
     <method name="Ping"/>
     <method name="GetMachineId">
       <arg name="machine_uuid" type="s" direction="out"/>
     </method>
   </interface>
</node>

Why is there no reference in the text to the signal such as signal name 
or the signature of the signal?
The same result can be achieved by using the console program d-feet.

With kind regards

Hans


More information about the User mailing list