From f8e8a30e338cf845a932917e6e267b9ab3f9b18d Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Tue, 6 Jun 2017 22:25:23 +0200 Subject: [PATCH] device-proxy: keep track of per-device DBus exported packet handlers --- src/mconnect/device-proxy.vala | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mconnect/device-proxy.vala b/src/mconnect/device-proxy.vala index 2db784f..4136901 100644 --- a/src/mconnect/device-proxy.vala +++ b/src/mconnect/device-proxy.vala @@ -18,6 +18,8 @@ * Maciek Borzecki */ +using Gee; + /** * General device wrapper. */ @@ -72,11 +74,14 @@ class DeviceDBusProxy : Object { private set; } + private ArrayList handlers; + [DBus (visible = false)] public Device device {get; private set; default = null; } public DeviceDBusProxy.for_device(Device device) { this.device = device; + this.handlers = new ArrayList(); this.update_address(); this.update_capabilities(); this.device.notify.connect(this.param_changed); @@ -84,6 +89,7 @@ class DeviceDBusProxy : Object { private void update_capabilities() { string[] caps = {}; + foreach (var cap in device.incoming_capabilities) { caps += cap; } @@ -129,4 +135,9 @@ class DeviceDBusProxy : Object { break; } } + + [DBus (visible = false)] + public void add_handler(PacketHandlerInterfaceProxy h) { + this.handlers.add(h); + } } \ No newline at end of file