summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-01-24 19:03:36 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-01-24 19:03:36 +0000
commit3ff37c86508033361fc1be271fd9895f3162ee03 (patch)
treed1bf8e1e8678568791c995abd2ce2b04b6713b64
parentb40a22456a9d9ff5b388152b9fe5d92369f77539 (diff)
Added GetVendorId
-rw-r--r--input/input-api.txt2
-rw-r--r--input/input-service.c13
2 files changed, 13 insertions, 2 deletions
diff --git a/input/input-api.txt b/input/input-api.txt
index 8157adc9..2658f3a6 100644
--- a/input/input-api.txt
+++ b/input/input-api.txt
@@ -54,7 +54,7 @@ Methods string GetAddress()
Returns the product id.
- string GetVendorId()
+ uint16 GetVendorId()
Returns the vendor id.
diff --git a/input/input-service.c b/input/input-service.c
index 877a3675..f14edfe1 100644
--- a/input/input-service.c
+++ b/input/input-service.c
@@ -860,7 +860,18 @@ static DBusHandlerResult device_get_product_id(DBusConnection *conn,
static DBusHandlerResult device_get_vendor_id(DBusConnection *conn,
DBusMessage *msg, void *data)
{
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ struct input_device *idev = data;
+ DBusMessage *reply;
+
+ reply = dbus_message_new_method_return(msg);
+ if (!reply)
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+
+ dbus_message_append_args(reply,
+ DBUS_TYPE_UINT16, &idev->hidp.vendor,
+ DBUS_TYPE_INVALID);
+
+ return send_message_and_unref(conn, reply);
}
static DBusHandlerResult device_set_timeout(DBusConnection *conn,