From: Andrei Emeltchenko <[email protected]>
---
android/client/if-hf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/android/client/if-hf.c b/android/client/if-hf.c
index 26c0139..269e029 100644
--- a/android/client/if-hf.c
+++ b/android/client/if-hf.c
@@ -386,7 +386,7 @@ static void init_p(int argc, const char **argv)
RETURN_IF_NULL(if_hf);
#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
- if (argc < 2)
+ if (argc <= 2)
max_hf_clients = 1;
else
max_hf_clients = atoi(argv[2]);
--
1.9.1
Hi Andrei,
On Wednesday 12 of November 2014 17:14:26 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <[email protected]>
>
> ---
> android/client/if-hf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/android/client/if-hf.c b/android/client/if-hf.c
> index 26c0139..269e029 100644
> --- a/android/client/if-hf.c
> +++ b/android/client/if-hf.c
> @@ -386,7 +386,7 @@ static void init_p(int argc, const char **argv)
> RETURN_IF_NULL(if_hf);
>
> #if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
> - if (argc < 2)
> + if (argc <= 2)
> max_hf_clients = 1;
> else
> max_hf_clients = atoi(argv[2]);
>
Applied, thanks.
--
Best regards,
Szymon Janc
From: Andrei Emeltchenko <[email protected]>
---
android/client/if-hf.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/android/client/if-hf.c b/android/client/if-hf.c
index 269e029..b0dd13a 100644
--- a/android/client/if-hf.c
+++ b/android/client/if-hf.c
@@ -355,6 +355,14 @@ static void key_pressed_cmd_cb(void)
}
#endif
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+static void wbs_cb(bthf_wbs_config_t wbs, bt_bdaddr_t *bd_addr)
+{
+ haltest_info("%s: bd_addr=%s\n", __func__,
+ bt_bdaddr_t2str(bd_addr, last_addr));
+}
+#endif
+
static bthf_callbacks_t hf_cbacks = {
.size = sizeof(hf_cbacks),
.connection_state_cb = connection_state_cb,
@@ -366,6 +374,9 @@ static bthf_callbacks_t hf_cbacks = {
.dial_call_cmd_cb = dial_call_cmd_cb,
.dtmf_cmd_cb = dtmf_cmd_cb,
.nrec_cmd_cb = nrec_cmd_cb,
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+ .wbs_cb = wbs_cb,
+#endif
.chld_cmd_cb = chld_cmd_cb,
.cnum_cmd_cb = cnum_cmd_cb,
.cind_cmd_cb = cind_cmd_cb,
--
1.9.1
From: Andrei Emeltchenko <[email protected]>
Add command configure_wbs() and helpers.
---
android/client/if-hf.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/android/client/if-hf.c b/android/client/if-hf.c
index c64d412..d24612a 100644
--- a/android/client/if-hf.c
+++ b/android/client/if-hf.c
@@ -105,6 +105,12 @@ SINTMAP(bthf_call_addrtype_t, -1, "(unknown)")
DELEMENT(BTHF_CALL_ADDRTYPE_INTERNATIONAL),
ENDMAP
+SINTMAP(bthf_wbs_config_t, -1, "(unknown)")
+ DELEMENT(BTHF_WBS_NONE),
+ DELEMENT(BTHF_WBS_NO),
+ DELEMENT(BTHF_WBS_YES),
+ENDMAP
+
/* Callbacks */
static char last_addr[MAX_ADDR_STR_LEN];
@@ -902,6 +908,35 @@ static void clcc_response_p(int argc, const char **argv)
#endif
}
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+static void configure_wbs_c(int argc, const char **argv, enum_func *enum_func,
+ void **user)
+{
+ if (argc == 4) {
+ *user = TYPE_ENUM(bthf_wbs_config_t);
+ *enum_func = enum_defines;
+ }
+}
+
+static void configure_wbs_p(int argc, const char **argv)
+{
+ bthf_wbs_config_t wbs;
+ bt_bdaddr_t addr;
+
+ RETURN_IF_NULL(if_hf);
+
+ if (argc <= 3) {
+ haltest_error("Too few parameters specified\n");
+ return;
+ }
+
+ VERIFY_ADDR_ARG(2, &addr);
+ wbs = str2bthf_wbs_config_t(argv[3]);
+
+ EXEC(if_hf->configure_wbs, &addr, wbs);
+}
+#endif
+
/* phone state change */
static void phone_state_change_c(int argc, const char **argv,
@@ -990,6 +1025,7 @@ static struct method methods[] = {
STD_METHODCH(clcc_response,
"<index> <direction> <state> <mode> <mpty> <number> "
"<type> <addr>"),
+ STD_METHODCH(configure_wbs, "<addr> <wbs config>"),
#else
STD_METHOD(init),
STD_METHOD(start_voice_recognition),
--
1.9.1
From: Andrei Emeltchenko <[email protected]>
---
android/client/if-hf.c | 37 ++++++++++++++++++++++++++++---------
1 file changed, 28 insertions(+), 9 deletions(-)
diff --git a/android/client/if-hf.c b/android/client/if-hf.c
index b0dd13a..c64d412 100644
--- a/android/client/if-hf.c
+++ b/android/client/if-hf.c
@@ -976,25 +976,44 @@ static void cleanup_p(int argc, const char **argv)
}
static struct method methods[] = {
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+ STD_METHODH(init, "[<max_hf_clients>]"),
+ STD_METHODH(start_voice_recognition, "<addr>"),
+ STD_METHODH(stop_voice_recognition, "<addr>"),
+ STD_METHODCH(volume_control, "<vol_type> <volume> <addr>"),
+ STD_METHODH(cops_response, "<cops string> <addr>"),
+ STD_METHODCH(cind_response,
+ "<svc> <num_active> <num_held> <setup_state> <signal> "
+ "<roam> <batt_chg> <addr>"),
+ STD_METHODH(formatted_at_response, "<at_response> <addr>"),
+ STD_METHODCH(at_response, "<response_code> [<error_code> <bdaddr>]"),
+ STD_METHODCH(clcc_response,
+ "<index> <direction> <state> <mode> <mpty> <number> "
+ "<type> <addr>"),
+#else
STD_METHOD(init),
- STD_METHODCH(connect, "<addr>"),
- STD_METHODCH(disconnect, "<addr>"),
- STD_METHODCH(connect_audio, "<addr>"),
- STD_METHODCH(disconnect_audio, "<addr>"),
STD_METHOD(start_voice_recognition),
STD_METHOD(stop_voice_recognition),
STD_METHODCH(volume_control, "<vol_type> <volume>"),
- STD_METHODCH(device_status_notification,
- "<ntk_state> <svt_type> <signal> <batt_chg>"),
STD_METHODH(cops_response, "<cops string>"),
STD_METHODCH(cind_response,
- "<svc> <num_active> <num_held> <setup_state> <signal> <roam> <batt_chg>"),
+ "<svc> <num_active> <num_held> <setup_state> <signal> "
+ "<roam> <batt_chg>"),
STD_METHODH(formatted_at_response, "<at_response>"),
STD_METHODCH(at_response, "<response_code> [<error_code>]"),
STD_METHODCH(clcc_response,
- "<index> <direction> <state> <mode> <mpty> <number> <type>"),
+ "<index> <direction> <state> <mode> <mpty> <number> "
+ "<type>"),
+#endif
+ STD_METHODCH(connect, "<addr>"),
+ STD_METHODCH(disconnect, "<addr>"),
+ STD_METHODCH(connect_audio, "<addr>"),
+ STD_METHODCH(disconnect_audio, "<addr>"),
+ STD_METHODCH(device_status_notification,
+ "<ntk_state> <svt_type> <signal> <batt_chg>"),
STD_METHODCH(phone_state_change,
- "<num_active> <num_held> <setup_state> <number> <type>"),
+ "<num_active> <num_held> <setup_state> <number> "
+ "<type>"),
STD_METHOD(cleanup),
END_METHOD
};
--
1.9.1