[pulseaudio-discuss] [RFCv0 15/21] bluetooth: Handle CardAdded signal
jprvita at gmail.com
jprvita at gmail.com
Tue Feb 4 14:04:00 PST 2014
From: João Paulo Rechi Vita <jprvita at openbossa.org>
---
src/modules/bluetooth/hfaudioagent-ofono.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/modules/bluetooth/hfaudioagent-ofono.c b/src/modules/bluetooth/hfaudioagent-ofono.c
index 23b10f0..9daf964 100644
--- a/src/modules/bluetooth/hfaudioagent-ofono.c
+++ b/src/modules/bluetooth/hfaudioagent-ofono.c
@@ -426,6 +426,24 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *da
}
}
+ } else if (dbus_message_is_signal(m, "org.ofono.HandsfreeAudioManager", "CardAdded")) {
+ const char *p;
+ DBusMessageIter arg_i, props_i;
+
+ if (!dbus_message_iter_init(m, &arg_i) || !pa_streq(dbus_message_get_signature(m), "oa{sv}")) {
+ pa_log_error("Failed to parse org.ofono.HandsfreeAudioManager.CardAdded");
+ goto fail;
+ }
+
+ dbus_message_iter_get_basic(&arg_i, &p);
+
+ pa_assert_se(dbus_message_iter_next(&arg_i));
+ pa_assert(dbus_message_iter_get_arg_type(&arg_i) == DBUS_TYPE_ARRAY);
+
+ dbus_message_iter_recurse(&arg_i, &props_i);
+
+ hf_audio_agent_card_found(hfdata, p, &props_i);
+
}
fail:
--
1.8.3.1
More information about the pulseaudio-discuss
mailing list