Diff between ffd21d4027cd91d864857d2d4c3664b3087c5e0a and b5494d7a8d18b3764161eac2be285e0c6beec67d

Changed Files

File Additions Deletions Status
proximity/monitor.c +7 -0 modified

Full Patch

diff --git a/proximity/monitor.c b/proximity/monitor.c
index 7e28b39..3b90df5 100644
--- a/proximity/monitor.c
+++ b/proximity/monitor.c
@@ -60,6 +60,7 @@ struct monitor {
 	struct enabled enabled;
 	char *linklosslevel;		/* Link Loss Alert Level */
 	char *immediatelevel;		/* Immediate Alert Level */
+	char *signallevel;		/* Path Loss RSSI level */
 };
 
 static inline int create_filename(char *buf, size_t size,
@@ -262,6 +263,10 @@ static DBusMessage *get_properties(DBusConnection *conn,
 		dict_append_entry(&dict, "ImmediateAlertLevel",
 				DBUS_TYPE_STRING, &monitor->linklosslevel);
 
+	if (monitor->enabled.pathloss)
+		dict_append_entry(&dict, "SignalLevel",
+				DBUS_TYPE_STRING, &monitor->signallevel);
+
 	dbus_message_iter_close_container(&iter, &dict);
 
 	return reply;
@@ -330,6 +335,7 @@ static void monitor_destroy(gpointer user_data)
 	btd_device_unref(monitor->device);
 	g_free(monitor->linklosslevel);
 	g_free(monitor->immediatelevel);
+	g_free(monitor->signallevel);
 	g_free(monitor);
 }
 
@@ -349,6 +355,7 @@ int monitor_register(DBusConnection *conn, struct btd_device *device,
 	monitor = g_new0(struct monitor, 1);
 	monitor->device = btd_device_ref(device);
 	monitor->linklosslevel = (level ? : g_strdup("none"));
+	monitor->signallevel = g_strdup("unknown");
 	monitor->enabled.linkloss = linkloss;
 	monitor->enabled.pathloss = pathloss;
 	monitor->enabled.findme = findme;