Skip to content

How to interpret signature a(sa{sv}) #445

Answered by sangelovic
Krulle86 asked this question in Q&A
Discussion options

You must be logged in to vote

The corresponding C++ type for a(sa{sv}) is std::vector<sdbus::Struct<std::string, std::map<std::string, sdbus::Variant>>>. The error tells you that are going to deserialize a struct, but there is an object of another type serialized in the D-Bus message at that location (an array in this case).

You can use the same operations on sdbus::Struct that you'd use on a std::tuple. In newer sdbus-c++ versions, the sdbus::Struct fully implements a tuple protocol, which makes it a tuple-like class (#343).

v1.0 is quite old. I suggest you upgrade to one of the latest versions (v1.6 or, even better, v2.0).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sangelovic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants