* [PATCH v3 0/2] add profile version to HandsfreeAgent
@ 2011-08-08 14:34 =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-08-08 14:34 ` [PATCH v3 1/2] hfpmodem: fix hf features =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-08-08 14:34 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 732 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.
For localhfp modem, use the highest version possible (0xFFFF) so it
will always send all implemented features.
Frédéric Danis (2):
hfpmodem: fix hf features
hfp_hf: retrieve AG version
drivers/hfpmodem/slc.c | 7 ++++++-
drivers/hfpmodem/slc.h | 5 ++++-
plugins/hfp_hf.c | 9 +++++----
plugins/phonesim.c | 2 +-
4 files changed, 16 insertions(+), 7 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 1/2] hfpmodem: fix hf features
2011-08-08 14:34 [PATCH v3 0/2] add profile version to HandsfreeAgent =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2011-08-08 14:34 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-08-08 14:34 ` [PATCH v3 2/2] hfp_hf: retrieve AG version =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-08-08 15:19 ` [PATCH v3 0/2] add profile version to HandsfreeAgent Denis Kenzior
2 siblings, 0 replies; 4+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-08-08 14:34 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2809 bytes --]
check audio gateway version and only set right features
---
drivers/hfpmodem/slc.c | 7 ++++++-
drivers/hfpmodem/slc.h | 5 ++++-
plugins/hfp_hf.c | 2 +-
plugins/phonesim.c | 2 +-
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/hfpmodem/slc.c b/drivers/hfpmodem/slc.c
index f9eca22..4028479 100644
--- a/drivers/hfpmodem/slc.c
+++ b/drivers/hfpmodem/slc.c
@@ -52,7 +52,7 @@ struct slc_establish_data {
gpointer userdata;
};
-void hfp_slc_info_init(struct hfp_slc_info *info)
+void hfp_slc_info_init(struct hfp_slc_info *info, guint16 version)
{
info->ag_features = 0;
info->ag_mpty_features = 0;
@@ -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 (version < HFP_VERSION_1_5)
+ 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..6c2302c 100644
--- a/drivers/hfpmodem/slc.h
+++ b/drivers/hfpmodem/slc.h
@@ -27,6 +27,9 @@
#define AG_CHLD_3 0x20
#define AG_CHLD_4 0x40
+#define HFP_VERSION_1_5 0x0105
+#define HFP_VERSION_LATEST 0xFFFF
+
enum hfp_indicator {
HFP_INDICATOR_SERVICE = 0,
HFP_INDICATOR_CALL,
@@ -49,7 +52,7 @@ struct hfp_slc_info {
unsigned int cind_val[HFP_INDICATOR_LAST];
};
-void hfp_slc_info_init(struct hfp_slc_info *info);
+void hfp_slc_info_init(struct hfp_slc_info *info, guint16 version);
void hfp_slc_info_free(struct hfp_slc_info *info);
void hfp_slc_establish(struct hfp_slc_info *info, hfp_slc_cb_t connect_cb,
diff --git a/plugins/hfp_hf.c b/plugins/hfp_hf.c
index 5625141..9fa420a 100644
--- a/plugins/hfp_hf.c
+++ b/plugins/hfp_hf.c
@@ -223,7 +223,7 @@ static int hfp_hf_probe(const char *device, const char *dev_addr,
if (data == NULL)
goto free;
- hfp_slc_info_init(&data->info);
+ hfp_slc_info_init(&data->info, HFP_VERSION_1_5);
data->handsfree_path = g_strdup(device);
if (data->handsfree_path == NULL)
diff --git a/plugins/phonesim.c b/plugins/phonesim.c
index 2b3bcf2..e81a2b4 100644
--- a/plugins/phonesim.c
+++ b/plugins/phonesim.c
@@ -880,7 +880,7 @@ static int localhfp_enable(struct ofono_modem *modem)
g_at_chat_set_disconnect_function(chat, slc_failed, modem);
- hfp_slc_info_init(info);
+ hfp_slc_info_init(info, HFP_VERSION_LATEST);
info->chat = chat;
hfp_slc_establish(info, slc_established, slc_failed, modem);
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v3 2/2] hfp_hf: retrieve AG version
2011-08-08 14:34 [PATCH v3 0/2] add profile version to HandsfreeAgent =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-08-08 14:34 ` [PATCH v3 1/2] hfpmodem: fix hf features =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2011-08-08 14:34 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-08-08 15:19 ` [PATCH v3 0/2] add profile version to HandsfreeAgent Denis Kenzior
2 siblings, 0 replies; 4+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2011-08-08 14:34 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1462 bytes --]
---
plugins/hfp_hf.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/plugins/hfp_hf.c b/plugins/hfp_hf.c
index 9fa420a..6516e75 100644
--- a/plugins/hfp_hf.c
+++ b/plugins/hfp_hf.c
@@ -161,11 +161,14 @@ static DBusMessage *hfp_agent_new_connection(DBusConnection *conn,
int fd, err;
struct ofono_modem *modem = data;
struct hfp_data *hfp_data = ofono_modem_get_data(modem);
+ guint16 version;
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UNIX_FD, &fd,
- DBUS_TYPE_INVALID))
+ DBUS_TYPE_UINT16, &version, DBUS_TYPE_INVALID))
return __ofono_error_invalid_args(msg);
+ hfp_slc_info_init(&hfp_data->info, version);
+
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, HFP_VERSION_1_5);
-
data->handsfree_path = g_strdup(device);
if (data->handsfree_path == NULL)
goto free;
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 0/2] add profile version to HandsfreeAgent
2011-08-08 14:34 [PATCH v3 0/2] add profile version to HandsfreeAgent =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-08-08 14:34 ` [PATCH v3 1/2] hfpmodem: fix hf features =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-08-08 14:34 ` [PATCH v3 2/2] hfp_hf: retrieve AG version =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2011-08-08 15:19 ` Denis Kenzior
2 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2011-08-08 15:19 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 888 bytes --]
Hi Frédéric,
On 08/08/2011 09:34 AM, Frédéric Danis wrote:
> 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.
> For localhfp modem, use the highest version possible (0xFFFF) so it
> will always send all implemented features.
>
> Frédéric Danis (2):
> hfpmodem: fix hf features
> hfp_hf: retrieve AG version
>
> drivers/hfpmodem/slc.c | 7 ++++++-
> drivers/hfpmodem/slc.h | 5 ++++-
> plugins/hfp_hf.c | 9 +++++----
> plugins/phonesim.c | 2 +-
> 4 files changed, 16 insertions(+), 7 deletions(-)
Both have been applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-08 15:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-08 14:34 [PATCH v3 0/2] add profile version to HandsfreeAgent =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-08-08 14:34 ` [PATCH v3 1/2] hfpmodem: fix hf features =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-08-08 14:34 ` [PATCH v3 2/2] hfp_hf: retrieve AG version =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-08-08 15:19 ` [PATCH v3 0/2] add profile version to HandsfreeAgent 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.