summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-adapter.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-10-30 18:39:38 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-10-30 18:39:38 +0000
commite54736f31acc8d26d1f1e4a8b06ed66d258a24ef (patch)
tree44c92453396549e9b82934ed7f1fa30f1d2a93a6 /hcid/dbus-adapter.c
parentc9b2f56a13df506191c284b7977abe7e7aa8f0e5 (diff)
Cleanup: split dbus.h into several dbus-*.h files (one for each dbus-*.c file)
Diffstat (limited to 'hcid/dbus-adapter.c')
-rw-r--r--hcid/dbus-adapter.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c
index ec27559e..8fecc265 100644
--- a/hcid/dbus-adapter.c
+++ b/hcid/dbus-adapter.c
@@ -42,10 +42,15 @@
#include "hcid.h"
#include "dbus.h"
+#include "dbus-adapter.h"
#include "textfile.h"
#include "oui.h"
#include "list.h"
+#include "dbus-common.h"
+#include "dbus-sdp.h"
+#include "dbus-error.h"
+#include "dbus-adapter.h"
static const char *service_cls[] = {
"positioning",
@@ -2773,33 +2778,14 @@ static struct service_data dev_services[] = {
{ NULL, NULL }
};
-DBusHandlerResult msg_func_device(DBusConnection *conn, DBusMessage *msg, void *data)
+DBusHandlerResult handle_adapter_method(DBusConnection *conn, DBusMessage *msg, void *data)
{
- const char *iface, *name;
+ service_handler_func_t handler;
- iface = dbus_message_get_interface(msg);
- name = dbus_message_get_member(msg);
+ handler = find_service_handler(dev_services, msg);
- if (!strcmp(DBUS_INTERFACE_INTROSPECTABLE, iface) &&
- !strcmp("Introspect", name)) {
- return simple_introspect(conn, msg, data);
- } else if (!strcmp(ADAPTER_INTERFACE, iface)) {
- service_handler_func_t handler;
-
- handler = find_service_handler(dev_services, msg);
-
- if (handler)
- return handler(conn, msg, data);
- else
- return error_unknown_method(conn, msg);
- } else if (!strcmp(SECURITY_INTERFACE, iface))
- return handle_security_method(conn, msg, data);
- else if (!strcmp(TEST_INTERFACE, iface))
- return handle_test_method(conn, msg, data);
- else if (!strcmp(RFCOMM_INTERFACE, iface))
- return handle_rfcomm_method(conn, msg, data);
- else if (!strcmp(SDP_INTERFACE, iface))
- return handle_sdp_method(conn, msg, data);
+ if (handler)
+ return handler(conn, msg, data);
else
return error_unknown_method(conn, msg);
}