Thread (15 messages) flat view 15 messages, 3 authors, 2011-08-03
STALE5489d

[PATCH BlueZ v2 5/6] Return an error if LinkLoss is disabled

From: Claudio Takahasi <hidden>
Date: 2011-07-28 14:43:35
Subsystem: the rest · Maintainer: Linus Torvalds

Changes SetProperty method of the Proximity Monitor to verify if the
LinkLoss service is enabled before allowing to change the alert level.
Not available error is returned if LinkLoss service is disabled in the
Proximity configuration file.
---
 proximity/monitor.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/proximity/monitor.c b/proximity/monitor.c
index 31691ff..dc480ab 100644
--- a/proximity/monitor.c
+++ b/proximity/monitor.c
@@ -241,6 +241,7 @@ static DBusMessage *get_properties(DBusConnection *conn,
 static DBusMessage *set_property(DBusConnection *conn,
 					DBusMessage *msg, void *data)
 {
+	struct monitor *monitor = data;
 	const char *property;
 	DBusMessageIter iter;
 	DBusMessageIter sub;
@@ -260,6 +261,9 @@ static DBusMessage *set_property(DBusConnection *conn,
 	dbus_message_iter_recurse(&iter, &sub);
 
 	if (g_str_equal("LinkLossAlertLevel", property)) {
+		if (monitor->enabled.linkloss == FALSE)
+			return btd_error_not_available(msg);
+
 		if (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_STRING)
 			return btd_error_invalid_args(msg);
 
-- 
1.7.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help