From 798e93e84b922975af0dd03ffb35bd8674b0504b Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Thu, 9 Jul 2015 12:21:31 +0200 Subject: Sync properties between server and client --- RemoteControlManager.xml | 2 +- rcm-server-main.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/RemoteControlManager.xml b/RemoteControlManager.xml index ede8f69..af9c33f 100644 --- a/RemoteControlManager.xml +++ b/RemoteControlManager.xml @@ -20,7 +20,7 @@ - + diff --git a/rcm-server-main.c b/rcm-server-main.c index 02387a1..3379697 100644 --- a/rcm-server-main.c +++ b/rcm-server-main.c @@ -40,9 +40,9 @@ find_device_by_path(struct manager *mgr, const char *path) } static int -property_get_driver_name(sd_bus *bus, const char *path, const char *interface, - const char *property, sd_bus_message *reply, void *userdata, - sd_bus_error *error) +property_get(sd_bus *bus, const char *path, const char *interface, + const char *property, sd_bus_message *reply, void *userdata, + sd_bus_error *error) { struct manager *mgr = userdata; struct device *dev; @@ -57,6 +57,8 @@ property_get_driver_name(sd_bus *bus, const char *path, const char *interface, return sd_bus_message_append(reply, "s", dev->driver_name); else if (!strcmp(property, "KernelKeymapName")) return sd_bus_message_append(reply, "s", dev->keymap_name); + else if (!strcmp(property, "HardwareType")) + return sd_bus_message_append(reply, "s", "ir"); sd_bus_error_set_const(error, "org.gnome.RemoteControlManager.InvalidProperty", "Sorry, invalid property"); return -EINVAL; @@ -177,8 +179,9 @@ out: static const sd_bus_vtable device_vtable[] = { SD_BUS_VTABLE_START(0), - SD_BUS_PROPERTY("DriverName", "s", property_get_driver_name, 0, 0), - SD_BUS_PROPERTY("KernelKeymapName", "s", property_get_driver_name, 0, 0), + SD_BUS_PROPERTY("DriverName", "s", property_get, 0, 0), + SD_BUS_PROPERTY("KernelKeymapName", "s", property_get, 0, 0), + SD_BUS_PROPERTY("HardwareType", "s", property_get, 0, 0), SD_BUS_METHOD("EchoString", "s", "s", method_echostring, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("ListKeymaps", NULL, "as", method_listkeymaps, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("GetKeymap", "s", "qqaa{sv}", method_getkeymap, SD_BUS_VTABLE_UNPRIVILEGED), -- cgit v1.2.3