diff options
author | Ulisses Furquim <ulissesf@gmail.com> | 2006-10-30 12:00:22 +0000 |
---|---|---|
committer | Ulisses Furquim <ulissesf@gmail.com> | 2006-10-30 12:00:22 +0000 |
commit | b8f5675259fe136a18f0f0d6578e8493f1e606ab (patch) | |
tree | 8400e63e67deb063c5a3a32ab0f371812e0388b4 | |
parent | 93af86b8230cd62fc64ff934fb5de3d65561608a (diff) |
Remove Interfaces() method and related code from the Service API
-rw-r--r-- | hcid/dbus-api.txt | 16 | ||||
-rw-r--r-- | hcid/dbus-service.c | 30 | ||||
-rw-r--r-- | hcid/service-agent.c | 40 |
3 files changed, 2 insertions, 84 deletions
diff --git a/hcid/dbus-api.txt b/hcid/dbus-api.txt index d79c7507..6bd3b48e 100644 --- a/hcid/dbus-api.txt +++ b/hcid/dbus-api.txt @@ -1046,12 +1046,7 @@ Service org.bluez Interface org.bluez.Service Object path path from org.bluez.Manager.ListServices() -Methods array{string} GetInterfaceNames() - - This methods gets the names of the interfaces - implemented by the service agent and returns them. - - string GetConnectionName() +Methods string GetConnectionName() This method returns the name of the connection to the service agent. @@ -1208,14 +1203,7 @@ Service unique name Interface org.bluez.ServiceAgent Object path freely definable -Methods array{string} Interfaces() - - This method must return the name of other interfaces - the agent implements and wants to export. The service - daemon does not know anything about these interfaces - so they can be service specific. - - void Start() +Methods void Start() This method gets called when the service daemon wants to start the service provided by the agent. diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c index a6f91df5..7acd7d4b 100644 --- a/hcid/dbus-service.c +++ b/hcid/dbus-service.c @@ -210,35 +210,6 @@ static void forward_reply(DBusPendingCall *call, void *udata) dbus_pending_call_unref (call); } -static DBusHandlerResult get_interface_names(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - DBusPendingCall *pending; - struct service_call *call_data; - struct service_agent *agent = data; - DBusMessage *forward = dbus_message_copy(msg); - const char *path = dbus_message_get_path(msg); - - dbus_message_set_destination(forward, agent->id); - dbus_message_set_interface(forward, "org.bluez.ServiceAgent"); - dbus_message_set_path(forward, path); - dbus_message_set_member(forward, "Interfaces"); - - call_data = malloc(sizeof(struct service_call)); - call_data->conn = dbus_connection_ref(conn); - call_data->msg = dbus_message_ref(msg); - - if (dbus_connection_send_with_reply(conn, forward, &pending, -1) == FALSE) { - dbus_message_unref(forward); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - - dbus_pending_call_set_notify(pending, forward_reply, call_data, service_call_free); - dbus_message_unref(forward); - - return DBUS_HANDLER_RESULT_HANDLED; -} - static DBusHandlerResult get_connection_name(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -564,7 +535,6 @@ static DBusHandlerResult remove_trust(DBusConnection *conn, static struct service_data services_methods[] = { { "GetName", get_name }, { "GetDescription", get_description }, - { "GetInterfaceNames", get_interface_names }, { "GetConnectionName", get_connection_name }, { "Start", start }, { "Stop", stop }, diff --git a/hcid/service-agent.c b/hcid/service-agent.c index 49218c85..d14b75d2 100644 --- a/hcid/service-agent.c +++ b/hcid/service-agent.c @@ -71,43 +71,6 @@ static DBusHandlerResult agent_filter(DBusConnection *conn, return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } -static DBusHandlerResult interfaces_message(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - DBusMessage *reply; - DBusMessageIter iter, array_iter; - const char *intf = "org.bluez.Example"; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) { - fprintf(stderr, "Invalid arguments for service Interfaces method"); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - - reply = dbus_message_new_method_return(msg); - if (!reply) { - fprintf(stderr, "Can't create reply message\n"); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - - dbus_message_iter_init_append(reply, &iter); - - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, - DBUS_TYPE_STRING_AS_STRING, &array_iter); - - dbus_message_iter_append_basic(&array_iter, - DBUS_TYPE_STRING, &intf); - - dbus_message_iter_close_container(&iter, &array_iter); - - dbus_connection_send(conn, reply, NULL); - - dbus_connection_flush(conn); - - dbus_message_unref(reply); - - return DBUS_HANDLER_RESULT_HANDLED; -} - static DBusHandlerResult start_message(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -201,9 +164,6 @@ static DBusHandlerResult release_message(DBusConnection *conn, static DBusHandlerResult service_message(DBusConnection *conn, DBusMessage *msg, void *data) { - if (dbus_message_is_method_call(msg, "org.bluez.ServiceAgent", "Interfaces")) - return interfaces_message(conn, msg, data); - if (dbus_message_is_method_call(msg, "org.bluez.ServiceAgent", "Start")) return start_message(conn, msg, data); |