Linux bluetooth development
 help / color / mirror / Atom feed
From: "David Stockwell" <dstockwell@frequency-one.com>
To: "BlueZ development" <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] Retrieving an Array of Strings, that is attached to a G_HASH_TABLE variant
Date: Thu, 5 Jun 2008 23:42:48 -0500	[thread overview]
Message-ID: <037601c8c78f$c71a00c0$6701a8c0@freqonedev> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 952 bytes --]

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;
    ++gPropValue;
  }
}

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

[-- Attachment #1.2: Type: text/html, Size: 2154 bytes --]

[-- Attachment #2: Type: text/plain, Size: 247 bytes --]

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

                 reply	other threads:[~2008-06-06  4:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='037601c8c78f$c71a00c0$6701a8c0@freqonedev' \
    --to=dstockwell@frequency-one.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox