Skip to content

How to get property #293

@roddc

Description

@roddc
const sysBus = dbus.systemBus();

const SERVICE_NAME = "org.freedesktop.NetworkManager";
const NM_OBJECT_PATH = "/org/freedesktop/NetworkManager";
const DEVICE_IFACE = "org.freedesktop.NetworkManager";

sysBus
  .getService(SERVICE_NAME)
  .getInterface(NM_OBJECT_PATH, DEVICE_IFACE, (err, nm) => {
    console.log(err, nm);
    //  This does not work, nm.Devices is not a function
   //  nm.Devices((e,v) => { console.log(e,v)});

   // This works
    nm.$readProp("Devices", (e, v) => {
      console.log(e, v);
    });
  });

How do I call the getter as a function?
I am using Node 16.19.

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