summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-10-27 16:43:06 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-10-27 16:43:06 +0000
commit6493a5e58c8effb15460446c7039ef7725cb2b9f (patch)
treef49d027ce67387a1faa3d27dd83d6d60698ac989 /hcid
parent3ea416e2abc2758b7e43127fe38284660ca4a3e1 (diff)
Return empty messages in case of start/stop and release
Diffstat (limited to 'hcid')
-rw-r--r--hcid/service-agent.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/hcid/service-agent.c b/hcid/service-agent.c
index fc6383bb..49218c85 100644
--- a/hcid/service-agent.c
+++ b/hcid/service-agent.c
@@ -111,6 +111,8 @@ static DBusHandlerResult interfaces_message(DBusConnection *conn,
static DBusHandlerResult start_message(DBusConnection *conn,
DBusMessage *msg, void *data)
{
+ DBusMessage *reply;
+
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) {
fprintf(stderr, "Invalid arguments for service Start method");
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -118,12 +120,28 @@ static DBusHandlerResult start_message(DBusConnection *conn,
printf("Starting example service\n");
+ 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_append_args(reply, DBUS_TYPE_INVALID);
+
+ dbus_connection_send(conn, reply, NULL);
+
+ dbus_connection_flush(conn);
+
+ dbus_message_unref(reply);
+
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult stop_message(DBusConnection *conn,
DBusMessage *msg, void *data)
{
+ DBusMessage *reply;
+
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) {
fprintf(stderr, "Invalid arguments for service Stop method");
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -131,12 +149,28 @@ static DBusHandlerResult stop_message(DBusConnection *conn,
printf("Stopping example service\n");
+ 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_append_args(reply, DBUS_TYPE_INVALID);
+
+ dbus_connection_send(conn, reply, NULL);
+
+ dbus_connection_flush(conn);
+
+ dbus_message_unref(reply);
+
return DBUS_HANDLER_RESULT_HANDLED;
}
static DBusHandlerResult release_message(DBusConnection *conn,
DBusMessage *msg, void *data)
{
+ DBusMessage *reply;
+
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) {
fprintf(stderr, "Invalid arguments for service Release method");
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -147,6 +181,20 @@ static DBusHandlerResult release_message(DBusConnection *conn,
__io_terminated = 1;
+ 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_append_args(reply, DBUS_TYPE_INVALID);
+
+ dbus_connection_send(conn, reply, NULL);
+
+ dbus_connection_flush(conn);
+
+ dbus_message_unref(reply);
+
return DBUS_HANDLER_RESULT_HANDLED;
}