Fallback to HFP 1.5 if defer setup is not supported since it is not
possible to proceed with codec negotiation.
---
 plugins/hfp_hf_bluez5.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index 5de6188..cc4e0a2 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -65,6 +65,7 @@ struct hfp {
 
 static GDBusClient *bluez = NULL;
 static guint sco_watch = 0;
+static uint16_t local_hfp_version = HFP_VERSION_1_6;
 
 static void hfp_debug(const char *str, void *user_data)
 {
@@ -502,9 +503,11 @@ static int sco_init(void)
        }
 
        if (setsockopt(sk, SOL_BLUETOOTH, BT_DEFER_SETUP,
-                               &defer_setup, sizeof(defer_setup)) < 0)
+                               &defer_setup, sizeof(defer_setup)) < 0) {
                ofono_warn("Can't enable deferred setup: %s (%d)",
                                                strerror(errno), errno);
+               local_hfp_version = HFP_VERSION_1_5;
+       }
 
        if (listen(sk, 5) < 0) {
                close(sk);
-- 
1.7.11.7

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

Reply via email to