emitInterfacesAdded method

Future<void> emitInterfacesAdded(
  1. DBusObjectPath path,
  2. Map<String, Map<String, DBusValue>> interfacesAndProperties
)

Emits org.freedesktop.DBus.ObjectManager.InterfacesAdded on this object. path is the path to the object that has been added or changed. interfacesAndProperties is the interfaces added to the object at path and the properties this object has.

Implementation

Future<void> emitInterfacesAdded(DBusObjectPath path,
    Map<String, Map<String, DBusValue>> interfacesAndProperties) async {
  DBusValue encodeProperties(Map<String, DBusValue> properties) =>
      DBusDict.stringVariant(properties);
  DBusValue encodeInterfacesAndProperties(
          Map<String, Map<String, DBusValue>> interfacesAndProperties) =>
      DBusDict(
          DBusSignature('s'),
          DBusSignature('a{sv}'),
          interfacesAndProperties.map<DBusValue, DBusValue>(
              (name, properties) =>
                  MapEntry(DBusString(name), encodeProperties(properties))));
  await emitSignal('org.freedesktop.DBus.ObjectManager', 'InterfacesAdded',
      [path, encodeInterfacesAndProperties(interfacesAndProperties)]);
}