DBus Help...

Martin Vidner mvidner at suse.cz
Mon Sep 19 08:14:48 PDT 2011


On Sat, Sep 17, 2011 at 07:20:35PM +0100, Iraq Ja wrote:
> Hi all,
> 
> I'm a new developer looking to write an application that interacts
> with Network Manager. I've attached my code to this e-mail, it
> compiles but doesn't work.
> 
> There are two lines in my code which I'm not certain about and
> couldn't find answers online.
> 
> 1. Line 16:   connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
>     I'm not sure about the fist parameter, I used the DBusBusType
> DBUS_BUS_SYSTEM because I couldn't find anything Network Manager
> specific.

Correct, NM is on the system bus.

> 2. Line 38:     if (!dbus_g_proxy_call (proxy, "GetAccessPoints()",
> &error, G_TYPE_INVALID, name_list, G_TYPE_INVALID))
>     this is where my program crashes.

That is because you shouldn't include the parentheses.
"GetAccessPoints", not "GetAccessPoints()".

Then it will not crash, but IIUC it is still wrong, as you are trying to
call a method of a WiFi device on the main manager object.

-- 
Martin Vidner, YaST developer
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20110919/178107a7/attachment.pgp>


More information about the dbus mailing list