summaryrefslogtreecommitdiffstats
path: root/plugins/hfp_hf_bluez5.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2013-02-20 19:26:18 -0300
committerDenis Kenzior <denkenz@gmail.com>2013-02-20 21:31:04 -0600
commit8a1cd911d8c27a8304a71d5a8625905633f6ad61 (patch)
tree72cdd967ebcd6e687cdd77196f0ac535b3545ba1 /plugins/hfp_hf_bluez5.c
parent5f787fed4e1592da7199f7e52cba6e8b1744f532 (diff)
downloadofono-8a1cd911d8c27a8304a71d5a8625905633f6ad61.tar.bz2
hfp_hf_bluez5: Add local HFP version tracking
Fallback to HFP 1.5 if defer setup is not supported since it is not possible to proceed with codec negotiation.
Diffstat (limited to 'plugins/hfp_hf_bluez5.c')
-rw-r--r--plugins/hfp_hf_bluez5.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index 5de61880..cc4e0a2d 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);