How to get property
roddc opened this issue · 2 comments
roddc commented
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.
sidorares commented
I haven't used dbus-native in a long time but what you do looks correct
All properties are added to the interface like this:
Line 155 in 2859556
What is the content of nm.$properties
?