Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.38 KB

README.md

File metadata and controls

45 lines (34 loc) · 1.38 KB

Low Level Bluez Dbus interfaces

Those are the low level Dbus interfaces. They can be used separately without using the convenience wrapper of the main library. Or in conjunction with the library to make up for some missing functionality.

Usage

Connect

The get an instance of an interface you can use the Interface::Connect method to directly

Example:

const bus = Dbus.systemBus();
const leMgr = await OrgBluezLEAdvertisingManager1.Connect(bus, "/org/bluez/hci0");

ProxyObject

If you already have a Proxy object from the bus. You can simply call the constructor

Example:

const bus = Dbus.systemBus();
const obj = await bus.getProxyObject("/org/bluez/hci0");
const leMgr = new OrgBluezLEAdvertisingManager1(obj);

Library

If you have a library Bluez object you can also use its getDbusObjectInterface method for convenience.

Example:

const bluez = new Bluez();
const leMgr = await bluez.getDbusObjectInterface(OrgBluezLEAdvertisingManager1, "/org/bluez/hci0");

Generation

Those interfaces are generated by dbus-next client interface generator.

  1. Connect devices with different interfaces to populate all Dbus Nodes.
  2. Then run the generator:
./helper/dbus-client-interface-generator.js --system --full -p --variant-any -t typescript-class-auto.ts -o src/dbus/ -r org.bluez /
  1. If necessary remove XML for device specific interfaces.