packing an array of dictionaries
koorapati, koundinya
Koundinya.Koorapati at dellteam.com
Tue May 19 12:36:21 UTC 2020
I was having issues with encoding data and figured out that this is the way I can achieve it.
GVariantBuilder *b1 = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_init (b1, G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_add (b1, "{sv}", "origin", g_variant_new_string("compat:suse:/etc/sysconfig/network/ifcfg-eth2"));
gchar array[] = {0x70, 0x4f, 0xd6, 0x77, 0x5d, 0x73, 0x5d, 0x80, 0x83, 0x90, 0x3b, 0x2b, 0xb0, 0x57, 0x2d, 0xff};
g_variant_builder_add (b1, "{sv}", "uuid", g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, array, 16, sizeof(gchar)));
g_variant_builder_add (b1, "{sv}", "owner-uid", g_variant_new_uint32(4294967295));
GVariant *v2 = g_variant_builder_end(b1);
g_variant_builder_unref(b1);
GVariantBuilder *b2 = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
g_variant_builder_init (b2, G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_add (b2, "{sv}", "config", v2);
GVariant *v3 = g_variant_builder_end(b2);
Thank You!
-----Original Message-----
From: dbus <dbus-bounces at lists.freedesktop.org> On Behalf Of Lawrence D'Oliveiro
Sent: Tuesday, May 19, 2020 4:15 AM
To: dbus at lists.freedesktop.org
Subject: Re: packing an array of dictionaries
[EXTERNAL EMAIL]
On Mon, 18 May 2020 13:20:00 +0000, koorapati, koundinya wrote:
> but are getting some or the other issue.
Maybe it would help if you told us what the issue was ...
_______________________________________________
dbus mailing list
dbus at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dbus
More information about the dbus
mailing list