Browse Source

device, devicemanager: support for updating device data using another Device instance

bboozzoo/pairing-fixes
Maciek Borzecki 8 years ago
parent
commit
dbdf2f8938
2 changed files with 12 additions and 0 deletions
  1. +10
    -0
      src/mconnect/device.vala
  2. +2
    -0
      src/mconnect/devicemanager.vala

+ 10
- 0
src/mconnect/device.vala View File

@ -361,4 +361,14 @@ class Device : Object {
return outgoing_capabilities.contains(capability) ||
incoming_capabilities.contains(capability);
}
public void update_from_device(Device other_dev) {
outgoing_capabilities = other_dev.outgoing_capabilities;
incoming_capabilities = other_dev.incoming_capabilities;
foreach (var cap in outgoing_capabilities) {
warning("updated cap: %s", cap);
}
host = other_dev.host;
tcp_port = other_dev.tcp_port;
}
}

+ 2
- 0
src/mconnect/devicemanager.vala View File

@ -123,6 +123,8 @@ class DeviceManager : GLib.Object
}
var dev = this.devices.@get(unique);
// update device information
dev.update_from_device(new_dev);
info("allowed? %s", dev.allowed.to_string());
// check if device is whitelisted in configuration


Loading…
Cancel
Save