Sending Signals with multiple parameters

Tiger79 tiger79 at gmail.com
Mon Aug 22 00:01:23 PDT 2011


Hi there,
I'd like to send multiple signasl containing multiple parameters,
for example somethign like :

<signal name="firstSignal">
	<arg name="data1" type="u" direction="out" />
	<arg name="data2" type="u" direction="out" />		
</signal>
		
<signal name="secondSignal">
	<arg name="data1" type="q" direction="out" />
	<arg name="data2" type="y" direction="out" />
	<arg name="data3" type="y" direction="out" />
</signal>

Now I have been trying some stuff ans some questions arised :

- first marshalling. I created the marshallers but should both be registered
and added as a signal ? (btw this is just the first signal):
dbus_g_object_register_marshaller(g_cclosure_marshal_VOID__UINT_UINT,
G_TYPE_NONE, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INVALID);
dbus_g_proxy_add_signal(remote_object, "MyDataSignal",
DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_INVALID);

- how to subsequently emit such a signal ? Like this ? 

void myData_part1_dbus_signal_send ( gint signalCode, ... )
{
guint signal = g_signal_new("my_data_part1",
		G_OBJECT_CLASS_TYPE(MYSERVER_GET_CLASS(myServerObj)),
		G_SIGNAL_RUN_LAST,
		0,
		NULL, NULL,
		g_cclosure_marshal_VOID__UINT_UINT,
		G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);

    va_list args;
    va_start ( args, signalCode);

    g_signal_emit_valist ( myServerObj,
    		signal,
            0,
            args );

    va_end ( args );
}

Any help would be appreciated or any examples/tutorials as well taking into
consideration I'm just starting out with dbus :P
Thanks in advance

-- 
View this message in context: http://old.nabble.com/Sending-Signals-with-multiple-parameters-tp32293096p32293096.html
Sent from the Free Desktop - dbus mailing list archive at Nabble.com.



More information about the dbus mailing list