Skip to content

Unable to write Struct dbus data type #237

Description

@muneale

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions