Browse Source

device-proxy: keep track of per-device DBus exported packet handlers

bboozzoo/wip
Maciek Borzecki 8 years ago
parent
commit
f8e8a30e33
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      src/mconnect/device-proxy.vala

+ 11
- 0
src/mconnect/device-proxy.vala View File

@ -18,6 +18,8 @@
* Maciek Borzecki <maciek.borzecki (at] gmail.com>
*/
using Gee;
/**
* General device wrapper.
*/
@ -72,11 +74,14 @@ class DeviceDBusProxy : Object {
private set;
}
private ArrayList<PacketHandlerInterfaceProxy> 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<PacketHandlerInterfaceProxy>();
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);
}
}

Loading…
Cancel
Save