d-bus method calle - receiving integer

Nuwan Rajitha Gunarathne nuwanr at opensource.lk
Wed May 12 01:37:58 PDT 2010


Hi,
I have written a program that implement a method call.
I want to get an integer as the return value.
when I run the program the remote method is invocate and no error returned.
But the returned integer remain zero(0).
I have included the core code fragment below.

my xml is

  <?xml version="1.0" encoding="UTF-8"?>

<node name="/org/dalesa/ProxyAdmin">
        <interface name="org.dalesa.ProxyAdmin">
                <!-- Add more methods/signals if you want -->
                <method name="GetProxyAdmin">
                        <arg type="av" name="pa" direction="out"/>
                </method>
                <method name="SetProxyAdmin">
                        <arg type="av" name="pa" direction="in"/>
                </method>
                <method name="ProxyAdminStop"/>
                <method name="ProxyAdminStart"/>
                <method name="ProxyAdminSearch">
                        <arg type="s" name="pas" direction ="in"/>
                        <arg type="i" name="offset" direction ="in"/>
                        <!--<arg type="a(ssuu)" name="pas" direction
="out"/> -->
                        <arg type="i" name="ret_offset" direction ="out"/>
                </method>
                <signal name="sig_0">
                <arg type="(ss)" name="dalesa_value_changed"
direction="out"/>
                </signal>
        </interface>
</node>
=========================================

*server.c*

//some code goes here
gboolean server_proxy_admin_search(ProxyAdmin *pa, char *search_str, int
offset,  gint *os, GError *err)
{
  g_type_init();
  os = 100;
}

==============================================
*client.c

*  gint ofst;
  printf("ofst %i \n", ofst);
  if (org_dalesa_ProxyAdmin_proxy_admin_search(driver_proxy, search_str,
offset, &ofst,  &error))
  {
    *err = DALESA_DBUS_OK;
    printf("ofst %i \n", ofst);
    return 0;
  }

The printf prints zero. Can anybody guess what im doing wrong here.

My next auestion is can I return both GPtArray and integer in a single
method?

for an example an xml is like


                <method name="ProxyAdminSearch">
                        <arg type="s" name="pas" direction ="in"/>
                        <arg type="i" name="offset" direction ="in"/>
                        <arg type="a(ssuu)" name="pas" direction ="out"/>
                        <arg type="i" name="ret_offset" direction ="out"/>
                </method>


Thanks
--Nuwan gunarathna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100512/ea4ce2b7/attachment.htm>


More information about the dbus mailing list