Now these characteristic values are updated when the agent changes any PASP alert state or setting. --- profiles/alert/server.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/profiles/alert/server.c b/profiles/alert/server.c index 3b74ad8..bde9056 100644 --- a/profiles/alert/server.c +++ b/profiles/alert/server.c @@ -339,6 +339,27 @@ static void update_new_alert(gpointer data, gpointer user_data) value[0], NULL); } +static void update_phone_alerts(const char *category, const char *description) +{ + unsigned int i; + + if (g_str_equal(category, "ringer")) { + if (g_str_equal(description, "enabled")) + ringer_setting = RINGER_NORMAL; + else if (g_str_equal(description, "disabled")) + ringer_setting = RINGER_SILENT; + } + + for (i = 0; i < G_N_ELEMENTS(pasp_categories); i++) { + if (g_str_equal(pasp_categories[i], category)) { + if (g_str_equal(description, "active")) + alert_status |= (1 << i); + else if (g_str_equal(description, "not active")) + alert_status &= ~(1 << i); + } + } +} + static DBusMessage *new_alert(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -399,6 +420,9 @@ static DBusMessage *new_alert(DBusConnection *conn, DBusMessage *msg, } } + if (pasp_category(category)) + update_phone_alerts(category, description); + DBG("NewAlert(\"%s\", %d, \"%s\")", category, count, description); return dbus_message_new_method_return(msg); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html