Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ldbus fixes #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Ldbus fixes #5

wants to merge 4 commits into from

Conversation

RafaGago
Copy link

@RafaGago RafaGago commented Feb 14, 2018

This fixes some issues/bugs.

*Reading/Writing complex DBUS messages (e.g. a{sa{sv}})
*Allows specifying the argument type for "variant" arguments.

See individual commits for further reference.

Rafael Gago added 4 commits February 12, 2018 12:54
This patch fixes cases where the 'opts' table passed by the user is
modified, making the external table unable to be reused in some
cases.

This was causing problems e.g. when dealing with properties, as the
user was having a predefined dbus options table, as the "interface"
key was changed internally to 'org.freedesktop.DBus.Properties'
without being changed back on return.
"append_arg" was broken for some nested types like "a{sa{sv}}" on the
ldbus backend. This reimplements append_arg, fixing the bugs.
On the ldbus backend the function dbus.new_variant has been added.
This allows overriding the variant type autodetection for types not
expressable as arguments on the LUA type system, e.g. 'o', which gets
translated to string.

Note that this function gets available as dbus.raw.new_variant

Example usage:

local variant = dbus.raw.new_variant

myvariant = {
	'v',
	variant('aa{sv}', {
		{ k1 = 'v1' }, --val is string variant (autodetected)
		{ k2 = variant ('o', '/some/dbus/path')}
	})
}
on the ldbus backend "iter_args" was completely broken for complex
types, calling a function returning "a{sa{sv}}" like e.g.
"org.freedesktop.NetworkmManager.Settings.Connection.GetSettings"
failed completely.

This patch reimplements "iter_args" correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant