This patch implements the HF initiate SCO connection for devices
compliant with HFP 1.6. HF sends AT+BCC to inform the AG that audio
connection is required.
---
 plugins/hfp_hf_bluez5.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index 0d5d5c7..6c55657 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -364,7 +364,18 @@ static struct ofono_handsfree_card_driver card_driver15 = {
 static int card_audio_connect16(const char *remote, const char *local,
                                                                void *data)
 {
-       return 0;
+       struct ofono_modem *modem = data;
+       struct hfp *hfp = ofono_modem_get_data(modem);
+       struct hfp_slc_info *info = &hfp->info;
+
+       if (info->chat == NULL)
+               return -ENOTCONN;
+
+       info->chat = g_at_chat_ref(info->chat);
+       g_at_chat_send(info->chat, "AT+BCC", NULL, NULL, info->chat,
+                                       (GDestroyNotify) g_at_chat_unref);
+
+       return -EINPROGRESS;
 }
 
 static struct ofono_handsfree_card_driver card_driver16 = {
-- 
1.7.11.7

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to