Open ash-microconnect opened 2 weeks ago
The VariantValue
type is optimized for reading, the Variant
type exists for writing variants.
These types are simply what is provided by Tmds.DBus.Protocol, see https://github.com/tmds/Tmds.DBus/blob/main/docs/protocol.md.
Thank you for directing me to that information. I have asked on that project about a method to translate from VariantValue to Variant (https://github.com/tmds/Tmds.DBus/issues/282).
FYI, https://github.com/tmds/Tmds.DBus/issues/303 tracks a change relevant to this discussion.
Please forgive me if there is a difference between
Variant
andVariantValue
whose behaviour I am misunderstanding. I have observed that a method return type whose signature isa{sa{sv}}
uses/maps toVariant
for the "v" whereas a method accepting a parameter with the same signature usesVariant
. This can be seen with the org.freedesktop.NetworkManager.Settings.Connection interface, where theGetSettings
method returns connection properties andUpdateSettings
is used to set connection properties. Their DBus definitions are:The generated proxy methods are:
This makes it difficult to modify a connection's properties (by first calling
GetSettings
, modifying the returned dictionary appropriately, then supplying that same modified dictionary toUpdate
), as the two methods use dictionaries of differing types. Is there a technical reason why the different types are used? Could the same type be used for both input and output parameters?Attached is the NetworkManager XML: NetworkManager-1.36.2-introspection.zip