I'm learning how to play with this g_variant_new() and it's really confusing me. I've read the https://developer.gnome.org/glib/unstable/glib-GVariant.html#g-variant-new but I can't understand it easily.
I have a code:
#define MM_DBUS_SERVICE "org.freedesktop.ModemManager1"
#define MM_DBUS_PATH "/org/freedesktop/ModemManager1/Modem/0"
#define MM_DBUS_GET_PROPERTIES  "org.freedesktop.DBus.Properties"
....
int i;
    GError *error = NULL;
    GVariant *ret;
    char **paths;
    ret = g_dbus_proxy_call_sync (proxy,
                          "org.freedesktop.DBus.Properties.Get",
                          g_variant_new ("(ss)",
                                      "org.freedesktop.ModemManager1.Modem",
                                      "SignalQuality"),
                          G_DBUS_CALL_FLAGS_NONE, -1,
                          NULL, &error);
    if (!ret) {
            g_dbus_error_strip_remote_error (error);
            g_print ("failed: %s\n", error->message);
            g_error_free (error);
            return;
    }
    g_variant_get (ret, "(v)", &paths);
    g_variant_unref (ret);
    for (i = 0; paths[i]; i++) {
            g_print ("Printing \n");
            g_print ("%s\n", paths[i]);
    }
    g_strfreev (paths);
It compiles fine but when it runs I get seg_fault. TESTING Printing
Printing Segmentation fault
The result I am expecting from this call is:
dbus-send --system --print-reply --dest=org.freedesktop.ModemManager1 "/org/freedesktop/ModemManager1/Modem/0" org.freedesktop.DBus.Properties.Get string:org.freedesktop.ModemManager1.Modem string:"SignalQuality"
method return sender=:1.1 -> dest=:1.121 reply_serial=2
   variant       struct {
       uint32 38
       boolean true
   }
How do I get the variant data structure and the data in it out of the call? How am I supposed to form the g_variant_new() call to accomplish this?
Thanks