@tanislav000/bluez
Version:
Bluez5 D-Bus bindings for easy to use bluetooth access in Node.js
37 lines • 2.27 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrgFreedesktopDBusObjectManager = void 0;
const utilts_1 = require("../utilts");
/*
* Generated by dbus-next interface generator
* Template: typescript-class-auto.ts.hbs
*/
// Introspection XML of org.bluez at /
const XMLObjectData = `
<node><interface name="org.freedesktop.DBus.Introspectable"><method name="Introspect"><arg name="xml" type="s" direction="out"/></method></interface><interface name="org.freedesktop.DBus.ObjectManager"><method name="GetManagedObjects"><arg name="objects" type="a{oa{sa{sv}}}" direction="out"/></method><signal name="InterfacesAdded"><arg name="object" type="o"/><arg name="interfaces" type="a{sa{sv}}"/></signal><signal name="InterfacesRemoved"><arg name="object" type="o"/><arg name="interfaces" type="as"/></signal></interface></node>`;
/**
* Service: org.bluez
* ObjectPath: /
* Interface: org.freedesktop.DBus.ObjectManager
*/
class OrgFreedesktopDBusObjectManager extends utilts_1.LooselyTypedEmitter {
static Connect(bus, objectPath = "/", xml = XMLObjectData) {
return bus.getProxyObject("org.bluez", objectPath, xml).then((obj) => new OrgFreedesktopDBusObjectManager(obj));
}
constructor(dbusObject) {
super();
this.dbusObject = dbusObject;
this.thisDBusInterface = this.dbusObject.getInterface("org.freedesktop.DBus.ObjectManager");
// forward all signals
this.on("newListener", this.thisDBusInterface.addListener.bind(this.thisDBusInterface));
this.on("removeListener", this.thisDBusInterface.removeListener.bind(this.thisDBusInterface));
}
/***** Methods *****/
//@method({ name: 'GetManagedObjects', inSignature: '', outSignature: 'a{oa{sa{sv}}}' })
GetManagedObjects() {
return this.thisDBusInterface.GetManagedObjects().then((0, utilts_1.unwrapDbusSignature)("a{oa{sa{sv}}}"));
}
}
exports.OrgFreedesktopDBusObjectManager = OrgFreedesktopDBusObjectManager;
OrgFreedesktopDBusObjectManager.DbusInterfaceName = "org.freedesktop.DBus.ObjectManager";
//# sourceMappingURL=DBus-ObjectManager.js.map