How to properly type dbus dicts

Asked by Brent Miller

I'm trying to build a simple C++ app that can talk to NetworkManager via DBus, query the connection state, and add new wifi connections.

However, I seem to be running into an issue when querying information about a network connection which has a type of `a{sa{sv}}`. I've been using the `dbus-cppc` as a starting point and it says the return type of org.freedesktop.NetworkManager.Settings.Connection.GetSettings should be:
`typedef std::vector<std::pair<std::string, std::vector<std::pair<std::string, core::dbus::types::Variant>>>> ResultType;`

But I'm getting a runtime error when running my app:
terminate called after throwing an instance of 'std::runtime_error'
  what(): Mismatch between expected and actual type reported by iterator:
  Expected: string
  Actual: dictionary_entry

The ResultType provided looks correct to me, and I've searched around a but could't find any of the examples that have a type like this. What's the proper ResultType for a dict within a dict? A stripped down example of what I'm working with can be found here:

Question information

English Edit question
Ubuntu dbus-cpp Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :

May help

You could send an email to the dbus developers. They may reply and help

Can you help with this problem?

Provide an answer of your own, or ask Brent Miller for more information if necessary.

To post a message you must log in.