[Gambas-user] Calling dbus method:how do I handle return values

RICHARD WALKER richard.j.walker at ...247...
Sun Jun 10 03:20:41 CEST 2012


I am trying to call a DBus method which takes one parameter and returns many.
The method details are:
<method name="GetGraph">
  <arg name="known_graph_version" type="t" direction="in" />
  <arg name="current_graph_version" type="t" direction="out" />
  <arg name="clients_and_ports" type="a(tsa(tsuu))" direction="out" />
  <arg name="connections" type="a(tstststst)" direction="out" />
</method>

If I use this:
Dim graph_details As New Variant[]

   If 0 < CurrentGraph Then graph_details = Jack.GetGraph(CurrentGraph)

...then graph_details[0] will return the numeric id for the graph (for
example, 223)


I don't seem to be able to guess what sort of variable to use for
assigning graph_details[1] and [2]. Stepping through the code it seems
to suggest that graph_details[1] is a Variant[][]. Same for
graph_details[2], but as I am completely and unredeemably confused by
array declaration syntax I am no closer to capturing these items.

Initially I thought that I could declare two variables to be of type
DBusVariant, set type signatures to "a(tsa(tsuu))" and "a(tstststst)",
and assign to them. But that is not how this apparently useful type is
expected to be used.

Anyone know how to achieve this?

Richard




More information about the User mailing list