* [PATCH 0/2] add profile version to HandsfreeAgent @ 2011-08-04 12:55 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis 2011-08-04 12:55 ` [PATCH 1/2] hfpmodem: fix hf features =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis 2011-08-04 12:55 ` [PATCH 2/2] hfp_hf: retrieve AG version =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis 0 siblings, 2 replies; 5+ messages in thread From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-08-04 12:55 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 576 bytes --] Some phones with HFP Audio Gateway version previous to 1.5 (i.e. Samsung SGH-D600 returning 0x0101 as profile version) do not accept an AT+BRSF with latest features. The Handsfree agent should adapt its AT+BRSF command depending on the remote version, so add version information as parameter of NewConnection method. Frédéric Danis (2): hfpmodem: fix hf features hfp_hf: retrieve AG version drivers/hfpmodem/slc.c | 5 +++++ drivers/hfpmodem/slc.h | 1 + plugins/hfp_hf.c | 7 ++++--- 3 files changed, 10 insertions(+), 3 deletions(-) ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] hfpmodem: fix hf features 2011-08-04 12:55 [PATCH 0/2] add profile version to HandsfreeAgent =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-08-04 12:55 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis 2011-08-05 22:09 ` Denis Kenzior 2011-08-04 12:55 ` [PATCH 2/2] hfp_hf: retrieve AG version =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis 1 sibling, 1 reply; 5+ messages in thread From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-08-04 12:55 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1250 bytes --] check audio gateway version and only set right features --- drivers/hfpmodem/slc.c | 5 +++++ drivers/hfpmodem/slc.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/hfpmodem/slc.c b/drivers/hfpmodem/slc.c index f9eca22..db1c3b9 100644 --- a/drivers/hfpmodem/slc.c +++ b/drivers/hfpmodem/slc.c @@ -60,9 +60,14 @@ void hfp_slc_info_init(struct hfp_slc_info *info) info->hf_features = HFP_HF_FEATURE_3WAY; info->hf_features |= HFP_HF_FEATURE_CLIP; info->hf_features |= HFP_HF_FEATURE_REMOTE_VOLUME_CONTROL; + + if (info->ag_version < 0x0105) + goto done; + info->hf_features |= HFP_HF_FEATURE_ENHANCED_CALL_STATUS; info->hf_features |= HFP_HF_FEATURE_ENHANCED_CALL_CONTROL; +done: memset(info->cind_val, 0, sizeof(info->cind_val)); memset(info->cind_pos, 0, sizeof(info->cind_pos)); } diff --git a/drivers/hfpmodem/slc.h b/drivers/hfpmodem/slc.h index f37a59c..7f4203f 100644 --- a/drivers/hfpmodem/slc.h +++ b/drivers/hfpmodem/slc.h @@ -42,6 +42,7 @@ typedef void (*hfp_slc_cb_t)(void *userdata); struct hfp_slc_info { GAtChat *chat; + int ag_version; unsigned int ag_features; unsigned int ag_mpty_features; unsigned int hf_features; -- 1.7.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] hfpmodem: fix hf features 2011-08-04 12:55 ` [PATCH 1/2] hfpmodem: fix hf features =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-08-05 22:09 ` Denis Kenzior 0 siblings, 0 replies; 5+ messages in thread From: Denis Kenzior @ 2011-08-05 22:09 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1504 bytes --] Hi Frédéric, On 08/04/2011 07:55 AM, Frédéric Danis wrote: > check audio gateway version and only set right features > --- > drivers/hfpmodem/slc.c | 5 +++++ > drivers/hfpmodem/slc.h | 1 + > 2 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/drivers/hfpmodem/slc.c b/drivers/hfpmodem/slc.c > index f9eca22..db1c3b9 100644 > --- a/drivers/hfpmodem/slc.c > +++ b/drivers/hfpmodem/slc.c > @@ -60,9 +60,14 @@ void hfp_slc_info_init(struct hfp_slc_info *info) > info->hf_features = HFP_HF_FEATURE_3WAY; > info->hf_features |= HFP_HF_FEATURE_CLIP; > info->hf_features |= HFP_HF_FEATURE_REMOTE_VOLUME_CONTROL; > + > + if (info->ag_version < 0x0105) > + goto done; > + > info->hf_features |= HFP_HF_FEATURE_ENHANCED_CALL_STATUS; > info->hf_features |= HFP_HF_FEATURE_ENHANCED_CALL_CONTROL; > > +done: > memset(info->cind_val, 0, sizeof(info->cind_val)); > memset(info->cind_pos, 0, sizeof(info->cind_pos)); > } > diff --git a/drivers/hfpmodem/slc.h b/drivers/hfpmodem/slc.h > index f37a59c..7f4203f 100644 > --- a/drivers/hfpmodem/slc.h > +++ b/drivers/hfpmodem/slc.h > @@ -42,6 +42,7 @@ typedef void (*hfp_slc_cb_t)(void *userdata); > > struct hfp_slc_info { > GAtChat *chat; > + int ag_version; I think you can avoid introducing this member if you simply pass the version into hfp_slc_info_init. > unsigned int ag_features; > unsigned int ag_mpty_features; > unsigned int hf_features; Regards, -Denis ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] hfp_hf: retrieve AG version 2011-08-04 12:55 [PATCH 0/2] add profile version to HandsfreeAgent =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis 2011-08-04 12:55 ` [PATCH 1/2] hfpmodem: fix hf features =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-08-04 12:55 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis 2011-08-05 22:13 ` Denis Kenzior 1 sibling, 1 reply; 5+ messages in thread From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-08-04 12:55 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1358 bytes --] --- plugins/hfp_hf.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/hfp_hf.c b/plugins/hfp_hf.c index 5625141..cf2bb42 100644 --- a/plugins/hfp_hf.c +++ b/plugins/hfp_hf.c @@ -163,9 +163,12 @@ static DBusMessage *hfp_agent_new_connection(DBusConnection *conn, struct hfp_data *hfp_data = ofono_modem_get_data(modem); if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UNIX_FD, &fd, + DBUS_TYPE_UINT16, &hfp_data->info.ag_version, DBUS_TYPE_INVALID)) return __ofono_error_invalid_args(msg); + hfp_slc_info_init(&hfp_data->info); + err = service_level_connection(modem, fd); if (err < 0 && err != -EINPROGRESS) return __ofono_error_failed(msg); @@ -192,7 +195,7 @@ static DBusMessage *hfp_agent_release(DBusConnection *conn, } static GDBusMethodTable agent_methods[] = { - { "NewConnection", "h", "", hfp_agent_new_connection, + { "NewConnection", "hq", "", hfp_agent_new_connection, G_DBUS_METHOD_FLAG_ASYNC }, { "Release", "", "", hfp_agent_release }, { NULL, NULL, NULL, NULL } @@ -223,8 +226,6 @@ static int hfp_hf_probe(const char *device, const char *dev_addr, if (data == NULL) goto free; - hfp_slc_info_init(&data->info); - data->handsfree_path = g_strdup(device); if (data->handsfree_path == NULL) goto free; -- 1.7.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] hfp_hf: retrieve AG version 2011-08-04 12:55 ` [PATCH 2/2] hfp_hf: retrieve AG version =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-08-05 22:13 ` Denis Kenzior 0 siblings, 0 replies; 5+ messages in thread From: Denis Kenzior @ 2011-08-05 22:13 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 2042 bytes --] Hi Frédéric, On 08/04/2011 07:55 AM, Frédéric Danis wrote: > --- > plugins/hfp_hf.c | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/plugins/hfp_hf.c b/plugins/hfp_hf.c > index 5625141..cf2bb42 100644 > --- a/plugins/hfp_hf.c > +++ b/plugins/hfp_hf.c > @@ -163,9 +163,12 @@ static DBusMessage *hfp_agent_new_connection(DBusConnection *conn, > struct hfp_data *hfp_data = ofono_modem_get_data(modem); > > if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UNIX_FD, &fd, > + DBUS_TYPE_UINT16, &hfp_data->info.ag_version, I don't like doing it this way, hfp_slc_info_init implies that it initializes the entire structure. Perhaps passing the version into hfp_slc_info_init would be better. Also, I don't know if we want to be a little 'nice' and allow the second argument to be omitted. For those that might still be running against an older version of BlueZ (and then retire this in a version or two of oFono) However, since there are not many users of hfp client right now I'm not particularly picky here. > DBUS_TYPE_INVALID)) > return __ofono_error_invalid_args(msg); > > + hfp_slc_info_init(&hfp_data->info); > + > err = service_level_connection(modem, fd); > if (err < 0 && err != -EINPROGRESS) > return __ofono_error_failed(msg); > @@ -192,7 +195,7 @@ static DBusMessage *hfp_agent_release(DBusConnection *conn, > } > > static GDBusMethodTable agent_methods[] = { > - { "NewConnection", "h", "", hfp_agent_new_connection, > + { "NewConnection", "hq", "", hfp_agent_new_connection, > G_DBUS_METHOD_FLAG_ASYNC }, > { "Release", "", "", hfp_agent_release }, > { NULL, NULL, NULL, NULL } > @@ -223,8 +226,6 @@ static int hfp_hf_probe(const char *device, const char *dev_addr, > if (data == NULL) > goto free; > > - hfp_slc_info_init(&data->info); > - > data->handsfree_path = g_strdup(device); > if (data->handsfree_path == NULL) > goto free; The rest looks good to me. Regards, -Denis ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-08-05 22:13 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-08-04 12:55 [PATCH 0/2] add profile version to HandsfreeAgent =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis 2011-08-04 12:55 ` [PATCH 1/2] hfpmodem: fix hf features =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis 2011-08-05 22:09 ` Denis Kenzior 2011-08-04 12:55 ` [PATCH 2/2] hfp_hf: retrieve AG version =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis 2011-08-05 22:13 ` Denis Kenzior
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.