<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>However, in a couple of cases, the value returned
is an array of pointers to strings (G_TYPE_STRV).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>To retrieve the strings, I am trying something like
the following:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>(GStrv) gPropValue = (GStrv)
g_hash_table_lookup(propTable, "Strings"); // Assume that the "key" is
"Strings"</FONT></DIV>
<DIV><FONT face=Arial size=2>if (gPropValue) {</FONT></DIV>
<DIV><FONT face=Arial size=2> while (*gPropValue) {</FONT></DIV>
<DIV><FONT face=Arial size=2> cout << *gPropValue
<< endl;</FONT></DIV>
<DIV><FONT face=Arial size=2> ++gPropValue;</FONT></DIV>
<DIV><FONT face=Arial size=2> }</FONT></DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I do get a properly terminated list of pointers,
but each pointer points to a null string. ('\0')</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>David Stockwell</FONT></DIV></BODY></HTML>