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

Unable to write Struct dbus data type #237

Open
muneale opened this issue Feb 18, 2022 · 0 comments
Open

Unable to write Struct dbus data type #237

muneale opened this issue Feb 18, 2022 · 0 comments

Comments

@muneale
Copy link

muneale commented Feb 18, 2022

I need to write the Addresses field on org.freedesktop.NetworkManager.IP6Config interface, which is Array of Struct (more precisely is a(ayuay)).
However, when I try to edit my configuration, the following error messagge appears:
ipv6.addresses: can't set property of type 'a(ayuay)' from value of type 'av'

This is a piece of my code:

...

newConf['ipv6'] = {
  method: "manual",
  addresses: [
      [...ip.toBuffer(config.ipv6['address']).swap64()],
      config.ipv6['prefix'],
      config.ipv6['gateway'] ? [...ip.toBuffer(config.ipv6['gateway']).swap64()] : [...Buffer.alloc(16)]
  ]
};

...

await new Promise((resolve, reject) => {
  nm.dbus().getInterface('org.freedesktop.NetworkManager', connection['objectPath'], 'org.freedesktop.NetworkManager.Settings.Connection', (error, conn) => {
    if (error) return reject(error);
    conn.Update(newConfig, (error) => {
      if (error) return reject(error);
      return resolve(null);
    });
  });
});

I had understood that I'm currently writing an array of variants, however I don't have any clue about how to solve it since it seems impossible to pass the dbus data type as argument.
Am I missing something? Or is there any workaround?

Thank you

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

No branches or pull requests

1 participant