summaryrefslogtreecommitdiffstats
path: root/network
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-09-28 13:38:45 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-09-28 13:38:45 +0000
commit583b6403808f16202ea6ace958209002e5441cd9 (patch)
treef39198aa8cf8e28846d032de0ef1ae020f72c60e /network
parenta558e0071fe657965e0b3928d72fd2318aa03087 (diff)
Add IsEnabled to server interface.
Diffstat (limited to 'network')
-rw-r--r--network/network-api.txt4
-rw-r--r--network/server.c17
2 files changed, 21 insertions, 0 deletions
diff --git a/network/network-api.txt b/network/network-api.txt
index 63ac05d2..e5916088 100644
--- a/network/network-api.txt
+++ b/network/network-api.txt
@@ -99,6 +99,10 @@ Methods string GetUUID()
Possible errors: org.bluez.network.Error.Failed
+ bool IsEnabled()
+
+ Returns the server status.
+
void SetName(string name)
Sets the name attribute.
diff --git a/network/server.c b/network/server.c
index 702c8fb3..4ac7328f 100644
--- a/network/server.c
+++ b/network/server.c
@@ -918,6 +918,22 @@ static DBusHandlerResult disable(DBusConnection *conn,
return send_message_and_unref(conn, reply);
}
+static DBusHandlerResult is_enabled(DBusConnection *conn, DBusMessage *msg,
+ void *data)
+{
+ struct network_server *ns = 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_BOOLEAN, &ns->enable,
+ DBUS_TYPE_INVALID);
+
+ return send_message_and_unref(conn, reply);
+}
+
static DBusHandlerResult set_name(DBusConnection *conn,
DBusMessage *msg, void *data)
{
@@ -1090,6 +1106,7 @@ static DBusMethodVTable server_methods[] = {
{ "GetUUID", get_uuid, "", "s" },
{ "Enable", enable, "", "" },
{ "Disable", disable, "", "" },
+ { "IsEnabled", is_enabled, "", "b" },
{ "SetName", set_name, "s", "" },
{ "GetName", get_name, "", "s" },
{ "SetAddressRange", set_address_range, "ss", "" },