summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-01-24 19:00:49 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-01-24 19:00:49 +0000
commitb40a22456a9d9ff5b388152b9fe5d92369f77539 (patch)
treed23e93663b0f93f1cf6991ea71507365fef5438a /input
parentffe5dd5b56c8a85fb8d47989477d8c9d1377f5e3 (diff)
Added GetProductId
Diffstat (limited to 'input')
-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 42ce2755..8157adc9 100644
--- a/input/input-api.txt
+++ b/input/input-api.txt
@@ -50,7 +50,7 @@ Methods string GetAddress()
Returns the service name.
- string GetProductId()
+ uint16 GetProductId()
Returns the product id.
diff --git a/input/input-service.c b/input/input-service.c
index c5d469e1..877a3675 100644
--- a/input/input-service.c
+++ b/input/input-service.c
@@ -843,7 +843,18 @@ static DBusHandlerResult device_get_name(DBusConnection *conn,
static DBusHandlerResult device_get_product_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.product,
+ DBUS_TYPE_INVALID);
+
+ return send_message_and_unref(conn, reply);
}
static DBusHandlerResult device_get_vendor_id(DBusConnection *conn,