-
Notifications
You must be signed in to change notification settings - Fork 33
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
Nested Array method parameters type "aay" (array of array of bytes) #367
Comments
Ive added a pull request with the changes necessary to allow this. |
I can't see any issues here. I took the example in https://gist.github.com/lemenkov/7515376 and implemented it using Dart using the generated code and it seems to work. Are you seeing any errors with this? import 'dart:convert';
import 'package:dbus/dbus.dart';
class OrgFreedesktopAvahiEntryGroup extends DBusRemoteObject {
OrgFreedesktopAvahiEntryGroup(
DBusClient client, String destination, DBusObjectPath path)
: super(client, name: destination, path: path);
/// Invokes org.freedesktop.Avahi.EntryGroup.AddService()
Future<void> callAddService(
int interface,
int protocol,
int flags,
String name,
String type,
String domain,
String host,
int port,
List<List<int>> txt,
{bool noAutoStart = false,
bool allowInteractiveAuthorization = false}) async {
await callMethod(
'org.freedesktop.Avahi.EntryGroup',
'AddService',
[
DBusInt32(interface),
DBusInt32(protocol),
DBusUint32(flags),
DBusString(name),
DBusString(type),
DBusString(domain),
DBusString(host),
DBusUint16(port),
DBusArray(
DBusSignature('ay'), txt.map((child) => DBusArray.byte(child)))
],
replySignature: DBusSignature(''),
noAutoStart: noAutoStart,
allowInteractiveAuthorization: allowInteractiveAuthorization);
}
}
Future<int> main(List<String> args) async {
var client = DBusClient.system();
var result = await client.callMethod(
destination: 'org.freedesktop.Avahi',
path: DBusObjectPath('/'),
interface: 'org.freedesktop.Avahi.Server',
name: 'EntryGroupNew',
replySignature: DBusSignature('o'));
var path = result.returnValues[0].asObjectPath();
print(path);
var o = OrgFreedesktopAvahiEntryGroup(client, 'org.freedesktop.Avahi', path);
await o.callAddService(
-1, -1, 0, 'test@Hostname', '_epmd._tcp', 'local', 'work.local', 4369, [
utf8.encode('[email protected]'),
utf8.encode('[email protected]'),
utf8.encode('status=avail')
]);
await client.close();
return 0;
} |
I swear I was....but now you have me thinking I just did a useless exercise. |
Well, its a long story but it all started trying to call AddService with an improper EntryGroup path. |
No problem, thanks for the feedback and good luck with your project! |
Unable to invoke method that requires a dbus parameter type='aay' or any nested arrays for that matter.
From avahi source:
[(https://github.com/lathiat/avahi/blob/e5b0badfc725b7fa9e6069b6a3d5f278d1b96113/avahi-daemon/org.freedesktop.Avahi.EntryGroup.xml)]
I am trying to call method AddService but am unable to create an nested DBusArray.
dart-dbus program seem to get it wrong as well.
Here is the pertinent xml definition of the object in a temp file named test.xml
$ ~/.pub-cache/bin/dart-dbus generate-remote-object test.xml -o test.dart
Note that method parameter for txt is "aay" and the code generated is
This does not work with the DBusSignature checking as DBusSignature('ay') is invalid.
Hopefully I am not missing something simple but it seems like nested arrays are not supported.
The text was updated successfully, but these errors were encountered: