You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to implement org.freedesktop.Notifications as "Hello, World" dbus application. When using notify-send "Title" "Message", the application should display on screen the message.
As per defined here, we need to first implement org.freedesktop.Notifications.GetServerInformation which takes no IN argument, but whose return values is OUT string, OUT string, OUT string, OUT string, so 4 output string values (not an array of string, which would be as).
I've tried it with:
iface.addMethod('GetServerInformation',{in: [],out: [DBus.Define(String),DBus.Define(String),DBus.Define(String),DBus.Define(String)]},function(callback){console.log('GetServerInformation was called.');callback(['Awesome Notification Server','example.org','0.1','1.2']);});
But then, when introspecting with gdbus introspect -e -d org.freedesktop.Notifications -o /org/freedesktop/Notifications I've got:
So it writes it as undefined, and when I try to call it with gdbus call [...], I've got () as return value and nodejs complains with Invalid type which makes sense.
No matter how I tried I could not manage to return several values (in this case 4 strings), so I defaulted to returning an array with:
iface.addMethod('GetServerInformation',{in: [],out: DBus.Define(Array)},function(callback){console.log('GetServerInformation was called.');callback(['Awesome Notification Server','example.org','0.1','1.2']);});
This time, when I introspect I've got:
interface org.freedesktop.Notifications {
methods:
GetServerInformation(out av arg_0);
which is consistent, but when I call with gdbus call [...] I've got:
Which is not 4 strings, and when I directly call notify-send, it fails too.
I've confirmed this is not the desired behavior by running a proper notification daemon (which works with notify-send) and when I call GetServerInformation with gdbus call [...] I've got this as result:
('Notification Daemon', 'GNOME', '3.18.2', '1.2')
which is 4 strings :-)
So my question is: how can I return 4 strings with this binding?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
I was trying to implement
org.freedesktop.Notifications
as "Hello, World" dbus application. When usingnotify-send "Title" "Message"
, the application should display on screen the message.As per defined here, we need to first implement
org.freedesktop.Notifications.GetServerInformation
which takes noIN
argument, but whose return values isOUT string, OUT string, OUT string, OUT string
, so 4 output string values (not an array of string, which would beas
).I've tried it with:
But then, when introspecting with
gdbus introspect -e -d org.freedesktop.Notifications -o /org/freedesktop/Notifications
I've got:So it writes it as undefined, and when I try to call it with
gdbus call [...]
, I've got()
as return value and nodejs complains withInvalid type
which makes sense.No matter how I tried I could not manage to return several values (in this case 4 strings), so I defaulted to returning an array with:
This time, when I introspect I've got:
which is consistent, but when I call with
gdbus call [...]
I've got:Which is not 4 strings, and when I directly call
notify-send
, it fails too.I've confirmed this is not the desired behavior by running a proper notification daemon (which works with
notify-send
) and when I callGetServerInformation
withgdbus call [...]
I've got this as result:which is 4 strings :-)
So my question is: how can I return 4 strings with this binding?
Thanks in advance.
The text was updated successfully, but these errors were encountered: