<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Hi All,</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">I am a beginner, trying to learn the sd_bus API's. <br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">I am trying to replicate the following busctl call to get information:</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">$ busctl call xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper GetObject sas /xyz/openbmc_project/inventory 0 --verbose<br>MESSAGE "a{sas}" {<br>        ARRAY "{sas}" {<br>                DICT_ENTRY "sas" {<br>                        STRING "xyz.openbmc_project.EntityManager";<br>                        ARRAY "s" {<br>                                STRING "org.freedesktop.DBus.Introspectable";<br>                                STRING "org.freedesktop.DBus.Peer";<br>                                STRING "org.freedesktop.DBus.Properties";<br>                        };<br>                };<br>                DICT_ENTRY "sas" {<br>                        STRING "xyz.openbmc_project.Inventory.Manager";<br>                        ARRAY "s" {<br>                                STRING "org.freedesktop.DBus.Introspectable";<br>                                STRING "org.freedesktop.DBus.ObjectManager";<br>                                STRING "org.freedesktop.DBus.Peer";<br>                                STRING "org.freedesktop.DBus.Properties";<br>                                STRING "xyz.openbmc_project.Inventory.Manager";<br>                        };<br>                };<br>                DICT_ENTRY "sas" {<br>                        STRING "xyz.openbmc_project.ObjectMapper";<br>                        ARRAY "s" {<br>                                STRING "org.freedesktop.DBus.Introspectable";<br>                                STRING "org.freedesktop.DBus.Peer";<br>                                STRING "org.freedesktop.DBus.Properties";<br>                        };<br>                };<br>                DICT_ENTRY "sas" {<br>                        STRING "xyz.openbmc_project.PLDM";<br>                        ARRAY "s" {<br>                                STRING "org.freedesktop.DBus.Introspectable";<br>                                STRING "org.freedesktop.DBus.ObjectManager";<br>                                STRING "org.freedesktop.DBus.Peer";<br>                                STRING "org.freedesktop.DBus.Properties";<br>                        };<br>                };<br>        };<br>};</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">In the `busctl monitor` i could confirm that i am getting a message of signature a{sas} from the dbus call, and here is the logic that I could come up with to read the data.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">    r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_ARRAY, "{sas}");<br>    if (r < 0)<br>        goto exit;<br>    while ((r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_DICT_ENTRY,<br>                                               "sas")) > 0)<br>    {<br>        char* service = NULL;<br>        r = sd_bus_message_read(reply, "s", &service);<br>        if (r < 0)<br>            goto exit;<br>        printf("service = %s\n", service);<br>        r = sd_bus_message_enter_container(reply, 'a', "s");<br>        if (r < 0)<br>            goto exit;<br>        for (;;)<br>        {<br>            const char* s;<br>            r = sd_bus_message_read(reply, "s", &s);<br>            if (r < 0)<br>                goto exit;<br>            if (r == 0)<br>                break;<br>            printf("%s\n", s);<br>        }<br>    }</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Output:</div><div class="gmail_default" style="font-family:monospace,monospace">service = xyz.openbmc_project.EntityManager<br>org.freedesktop.DBus.Introspectable<br>org.freedesktop.DBus.Peer<br>org.freedesktop.DBus.Properties</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">But, I was only able to get the data from the first dictionary, can anyone help me to solve this issue? what am I missing?</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Thanks,</div><div class="gmail_default" style="font-family:monospace,monospace">Manoj<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div></div>