summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-11-13 15:15:00 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-11-13 15:15:00 +0000
commitbb83060114ca74dc711b93c44693977e7dd4f5ad (patch)
tree4272e43bcf87b9c303d59b6c606aa000b9a07ec9
parentd0f6da96bcbb1ba20d7508294733ab46519e07b2 (diff)
Preparation for the Input interface implementation
-rw-r--r--input/input-service.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/input/input-service.c b/input/input-service.c
index 15e37e44..a64b1c25 100644
--- a/input/input-service.c
+++ b/input/input-service.c
@@ -25,6 +25,7 @@
#include <config.h>
#endif
+#include <string.h>
#include <signal.h>
#include "dbus.h"
@@ -104,23 +105,33 @@ static DBusHandlerResult release_message(DBusConnection *conn,
return DBUS_HANDLER_RESULT_HANDLED;
}
-
static DBusHandlerResult input_message(DBusConnection *conn,
DBusMessage *msg, void *data)
{
- if (dbus_message_is_method_call(msg, "org.bluez.ServiceAgent", "Start"))
- return start_message(conn, msg, data);
+ const char *interface;
+ const char *member;
+
+ interface = dbus_message_get_interface(msg);
+ member = dbus_message_get_member(msg);
+
+ if (strcmp(interface, "org.bluez.ServiceAgent") == 0) {
+ if (strcmp(member, "Start") == 0)
+ return start_message(conn, msg, data);
+ if (strcmp(member, "Stop") == 0)
+ return stop_message(conn, msg, data);
+ if (strcmp(member, "Release") == 0)
+ return release_message(conn, msg, data);
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ }
- if (dbus_message_is_method_call(msg, "org.bluez.ServiceAgent", "Stop"))
- return stop_message(conn, msg, data);
+ if (strcmp(interface, "org.bluez.Input") != 0)
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- if (dbus_message_is_method_call(msg, "org.bluez.ServiceAgent", "Release"))
- return release_message(conn, msg, data);
+ /* Handle Input interface methods here */
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
-
static const DBusObjectPathVTable input_table = {
.message_function = input_message,
};