Class: ProxyObject

ProxyObject()

A class that represents a proxy to a DBus object. The ProxyObject contains ProxyInterfaces and a list of nodes which are object paths of child objects. A ProxyObject is created through MessageBus#getProxyObject for a given well-known name and object path. An interface can be gotten through ProxyObject#getInterface and can be used to call methods and receive signals for that interface.

Constructor

new ProxyObject()

Create a new ProxyObject. This constructor should not be called directly. Use MessageBus#getProxyObject to get a proxy object.

Source:
Example
let bus = dbus.sessionBus();
let obj = await bus.getProxyObject('org.freedesktop.DBus', '/org/freedesktop/DBus');
let peer = obj.getInterface('org.freedesktop.DBus.Peer')
await peer.Ping();

Members

bus :MessageBus

The MessageBus this name belongs to.

Type:
Source:

interfaces :Object.<string, ProxyInterface>

A map of interface names to ProxyInterfaces for this ProxyObject.

Type:
Source:

name :string

The well-known bus name for this proxy object as a string.

Type:
  • string
Source:

nodes :Array.<string>

The object path child nodes for this ProxyObject as an array of strings

Type:
  • Array.<string>
Source:

path :string

The object path for this ProxyObject.

Type:
  • string
Source:

Methods

getInterface(name) → {ProxyInterface}

Get a ProxyInterface for the given interface name.

Parameters:
Name Type Description
name string

the interface name to get.

Source:
Throws:

Throws an error if the interface is not found on this object.

Type
Error
Returns:
  • the proxy interface with this name exported by the object or undefined if the object does not export an interface with that name.
Type
ProxyInterface