Constructor
new Interface()
Create an interface. This should be called with the name of the interface in the class that extends it.
- Source:
Example
class MyInterface extends Interface {
constructor() {
super('org.test.interface_name');
}
// define properties, methods, and signals with decorated functions
}
let bus = dbus.sessionBus();
let name = await bus.requestName('org.test.bus_name');
let iface = new MyInterface();
name.export('/org/test/path', iface);
Methods
(static) configureMembers(members)
An alternative to the decorator functions to configure
Interface
DBus members when
decorators cannot be supported.
Calling this method twice on the same Interface
or mixing this method
with the decorator interface will result in undefined behavior that may be
specified at a future time.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
members |
Object | Member configuration object. Properties
|
- Source:
Example
ConfiguredInterface.configureMembers({
properties: {
SomeProperty: {
signature: 's'
}
},
methods: {
Echo: {
inSignature: 'v',
outSignature: 'v'
}
},
signals: {
HelloWorld: {
signature: 'ss'
}
}
});
(static) emitPropertiesChanged(iface, changedProperties, invalidatedProperties)
Emit the PropertiesChanged
signal on an Interface
s associated standard
org.freedesktop.DBus.Properties
interface with a map of new values and
invalidated properties. Pass the properties as JavaScript values.
Parameters:
Name | Type | Description |
---|---|---|
iface |
module:interface~Interface | the |
changedProperties |
Object | A map of property names and new property values that are changed. |
invalidatedProperties |
Array.<string> | A list of invalidated properties. |
- Source:
Example
Interface.emitPropertiesChanged({ SomeProperty: 'bar' }, ['InvalidedProperty']);