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.
This commit is contained in:
Claudio Takahasi 2013-02-20 19:26:18 -03:00 committed by Denis Kenzior
parent 5f787fed4e
commit 8a1cd911d8
1 changed files with 4 additions and 1 deletions

View File

@ -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);