diff --git a/src/mconnect/devicemanager-proxy.vala b/src/mconnect/devicemanager-proxy.vala index 9a962f4..33acb5d 100644 --- a/src/mconnect/devicemanager-proxy.vala +++ b/src/mconnect/devicemanager-proxy.vala @@ -39,6 +39,7 @@ class DeviceManagerDBusProxy : Object manager.found_new_device.connect((d) => { this.add_device(d); }); + manager.device_capability_added.connect(this.add_device_capability); } [DBus (visible = false)] @@ -97,6 +98,29 @@ class DeviceManagerDBusProxy : Object } } + private void add_device_capability(Device dev, + string capability, + PacketHandlerInterface iface) { + + ObjectPath path = null; + foreach (var entry in this.devices.entries) { + if (entry.value.device == dev) { + path = new ObjectPath(entry.key); + break; + } + } + + if (path == null) { + warning("no path for device?"); + return; + } + + info("add capability handler %s for device at path %s", + capability, path.to_string()); + // TODO: + // PacketHandlersProxy.register_capability(path, capability, iface); + } + /** * make_device_path: *