Retrieving an Array of Strings, that is attached to a G_HASH_TABLE variant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

In Bluez, certain messages return a GHashTable of type (G_TYPE_STRING, G_TYPE_VALUE), so the key is a String, and the value is a Variant.  Many of the values returned are boolean, integer, and other simple types; others are a boxed Object Path.  These I can handle.
However, in a couple of cases, the value returned is an array of pointers to strings (G_TYPE_STRV).
To retrieve the strings, I am trying something like the following:
(GStrv) gPropValue = (GStrv) g_hash_table_lookup(propTable, "Strings"); // Assume that the "key" is "Strings"
if (gPropValue) {
  while (*gPropValue) {
    cout << *gPropValue << endl;
I do get a properly terminated list of pointers, but each pointer points to a null string. ('\0')
I have not yet added debug statements to syslog (my next step) into the system level code, but why are the strings not filled in?  What else am I missing?  Any suggestions?
David Stockwell
Check out the new Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
Bluez-devel mailing list

[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux