2014-03-18 13:29:52

by Ravi kumar Veeramally

[permalink] [raw]
Subject: [PATCH_v2 1/8] android/client: Add AVRCP set_player_app_value_rsp support

---
android/client/if-rc.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index 60c3247..2e93c02 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -46,6 +46,14 @@ SINTMAP(btrc_media_attr_t, -1, "(unknown)")
DELEMENT(BTRC_MEDIA_ATTR_PLAYING_TIME),
ENDMAP

+SINTMAP(btrc_status_t, -1, "(unknown)")
+ DELEMENT(BTRC_STS_BAD_CMD),
+ DELEMENT(BTRC_STS_BAD_PARAM),
+ DELEMENT(BTRC_STS_NOT_FOUND),
+ DELEMENT(BTRC_STS_INTERNAL_ERR),
+ DELEMENT(BTRC_STS_NO_ERROR),
+ENDMAP
+
static char last_addr[MAX_ADDR_STR_LEN];

static void remote_features_cb(bt_bdaddr_t *bd_addr,
@@ -196,6 +204,33 @@ static void set_volume_p(int argc, const char **argv)
EXEC(if_rc->set_volume, volume);
}

+/* set_player_app_value_rsp */
+
+static void set_player_app_value_rsp_c(int argc, const char **argv,
+ enum_func *enum_func, void **user)
+{
+ if (argc == 3) {
+ *user = TYPE_ENUM(btrc_status_t);
+ *enum_func = enum_defines;
+ }
+}
+
+static void set_player_app_value_rsp_p(int argc, const char **argv)
+{
+ btrc_status_t rsp_status;
+
+ RETURN_IF_NULL(if_rc);
+
+ if (argc <= 2) {
+ haltest_error("No response status specified");
+ return;
+ }
+
+ rsp_status = str2btrc_status_t(argv[2]);
+
+ EXEC(if_rc->set_player_app_value_rsp, rsp_status);
+}
+
/* cleanup */

static void cleanup_p(int argc, const char **argv)
@@ -211,6 +246,7 @@ static struct method methods[] = {
STD_METHODCH(get_play_status_rsp,
"<play_status> <song_len> <song_pos>"),
STD_METHODCH(get_element_attr_rsp, "<num_attr> <attrs_id> <value>"),
+ STD_METHODCH(set_player_app_value_rsp, "<rsp_status>"),
STD_METHODCH(set_volume, "<volume>"),
STD_METHOD(cleanup),
END_METHOD
--
1.8.3.2



2014-03-18 14:58:55

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH_v2 1/8] android/client: Add AVRCP set_player_app_value_rsp support

Hi Ravi,

On Tue, Mar 18, 2014 at 3:29 PM, Ravi kumar Veeramally
<[email protected]> wrote:
> ---
> android/client/if-rc.c | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/android/client/if-rc.c b/android/client/if-rc.c
> index 60c3247..2e93c02 100644
> --- a/android/client/if-rc.c
> +++ b/android/client/if-rc.c
> @@ -46,6 +46,14 @@ SINTMAP(btrc_media_attr_t, -1, "(unknown)")
> DELEMENT(BTRC_MEDIA_ATTR_PLAYING_TIME),
> ENDMAP
>
> +SINTMAP(btrc_status_t, -1, "(unknown)")
> + DELEMENT(BTRC_STS_BAD_CMD),
> + DELEMENT(BTRC_STS_BAD_PARAM),
> + DELEMENT(BTRC_STS_NOT_FOUND),
> + DELEMENT(BTRC_STS_INTERNAL_ERR),
> + DELEMENT(BTRC_STS_NO_ERROR),
> +ENDMAP
> +
> static char last_addr[MAX_ADDR_STR_LEN];
>
> static void remote_features_cb(bt_bdaddr_t *bd_addr,
> @@ -196,6 +204,33 @@ static void set_volume_p(int argc, const char **argv)
> EXEC(if_rc->set_volume, volume);
> }
>
> +/* set_player_app_value_rsp */
> +
> +static void set_player_app_value_rsp_c(int argc, const char **argv,
> + enum_func *enum_func, void **user)
> +{
> + if (argc == 3) {
> + *user = TYPE_ENUM(btrc_status_t);
> + *enum_func = enum_defines;
> + }
> +}
> +
> +static void set_player_app_value_rsp_p(int argc, const char **argv)
> +{
> + btrc_status_t rsp_status;
> +
> + RETURN_IF_NULL(if_rc);
> +
> + if (argc <= 2) {
> + haltest_error("No response status specified");
> + return;
> + }
> +
> + rsp_status = str2btrc_status_t(argv[2]);
> +
> + EXEC(if_rc->set_player_app_value_rsp, rsp_status);
> +}
> +
> /* cleanup */
>
> static void cleanup_p(int argc, const char **argv)
> @@ -211,6 +246,7 @@ static struct method methods[] = {
> STD_METHODCH(get_play_status_rsp,
> "<play_status> <song_len> <song_pos>"),
> STD_METHODCH(get_element_attr_rsp, "<num_attr> <attrs_id> <value>"),
> + STD_METHODCH(set_player_app_value_rsp, "<rsp_status>"),
> STD_METHODCH(set_volume, "<volume>"),
> STD_METHOD(cleanup),
> END_METHOD
> --
> 1.8.3.2

Applied, thanks.


--
Luiz Augusto von Dentz

2014-03-18 13:29:57

by Ravi kumar Veeramally

[permalink] [raw]
Subject: [PATCH_v2 6/8] android/client: Add AVRCP get_player_app_attrs_text_cb support

---
android/client/if-rc.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index 4a17e11..4ae4fcd 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -79,6 +79,18 @@ static void get_player_app_value_cb(uint8_t num_attr,
haltest_info("attribute=%u\n", p_attrs[i]);
}

+static void get_player_app_attrs_text_cb(uint8_t num_attr,
+ btrc_player_attr_t *p_attrs)
+{
+ int i;
+
+ haltest_info("%s, num_attr=%d\n", __func__, num_attr);
+
+ for (i = 0; i < num_attr; i++)
+ haltest_info("attribute=%u\n", p_attrs[i]);
+
+}
+
static void get_player_app_values_text_cb(uint8_t attr_id, uint8_t num_val,
uint8_t *p_vals)
{
@@ -127,6 +139,7 @@ static btrc_callbacks_t rc_cbacks = {
.remote_features_cb = remote_features_cb,
.get_play_status_cb = get_play_status_cb,
.get_player_app_value_cb = get_player_app_value_cb,
+ .get_player_app_attrs_text_cb = get_player_app_attrs_text_cb,
.get_player_app_values_text_cb = get_player_app_values_text_cb,
.set_player_app_value_cb = set_player_app_value_cb,
.get_element_attr_cb = get_element_attr_cb,
--
1.8.3.2


2014-03-18 13:29:59

by Ravi kumar Veeramally

[permalink] [raw]
Subject: [PATCH_v2 8/8] android/client: Add AVRCP list_player_app_attr_cb support

---
android/client/if-rc.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index 7cdc07d..31efc29 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -68,6 +68,11 @@ static void get_play_status_cb(void)
haltest_info("%s\n", __func__);
}

+static void list_player_app_attr_cb(void)
+{
+ haltest_info("%s\n", __func__);
+}
+
static void list_player_app_values_cb(btrc_player_attr_t attr_id)
{
haltest_info("%s, attr_id=%d\n", __func__, attr_id);
@@ -143,6 +148,7 @@ static btrc_callbacks_t rc_cbacks = {
.size = sizeof(rc_cbacks),
.remote_features_cb = remote_features_cb,
.get_play_status_cb = get_play_status_cb,
+ .list_player_app_attr_cb = list_player_app_attr_cb,
.list_player_app_values_cb = list_player_app_values_cb,
.get_player_app_value_cb = get_player_app_value_cb,
.get_player_app_attrs_text_cb = get_player_app_attrs_text_cb,
--
1.8.3.2


2014-03-18 13:29:58

by Ravi kumar Veeramally

[permalink] [raw]
Subject: [PATCH_v2 7/8] android/client: Add AVRCP list_player_app_values_cb support

---
android/client/if-rc.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index 4ae4fcd..7cdc07d 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -68,6 +68,11 @@ static void get_play_status_cb(void)
haltest_info("%s\n", __func__);
}

+static void list_player_app_values_cb(btrc_player_attr_t attr_id)
+{
+ haltest_info("%s, attr_id=%d\n", __func__, attr_id);
+}
+
static void get_player_app_value_cb(uint8_t num_attr,
btrc_player_attr_t *p_attrs)
{
@@ -138,6 +143,7 @@ static btrc_callbacks_t rc_cbacks = {
.size = sizeof(rc_cbacks),
.remote_features_cb = remote_features_cb,
.get_play_status_cb = get_play_status_cb,
+ .list_player_app_values_cb = list_player_app_values_cb,
.get_player_app_value_cb = get_player_app_value_cb,
.get_player_app_attrs_text_cb = get_player_app_attrs_text_cb,
.get_player_app_values_text_cb = get_player_app_values_text_cb,
--
1.8.3.2


2014-03-18 13:29:56

by Ravi kumar Veeramally

[permalink] [raw]
Subject: [PATCH_v2 5/8] android/client: Add AVRCP get_player_app_value_cb support

---
android/client/if-rc.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index 03fad8f..4a17e11 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -68,6 +68,17 @@ static void get_play_status_cb(void)
haltest_info("%s\n", __func__);
}

+static void get_player_app_value_cb(uint8_t num_attr,
+ btrc_player_attr_t *p_attrs)
+{
+ int i;
+
+ haltest_info("%s, num_attr=%d\n", __func__, num_attr);
+
+ for (i = 0; i < num_attr; i++)
+ haltest_info("attribute=%u\n", p_attrs[i]);
+}
+
static void get_player_app_values_text_cb(uint8_t attr_id, uint8_t num_val,
uint8_t *p_vals)
{
@@ -115,6 +126,7 @@ static btrc_callbacks_t rc_cbacks = {
.size = sizeof(rc_cbacks),
.remote_features_cb = remote_features_cb,
.get_play_status_cb = get_play_status_cb,
+ .get_player_app_value_cb = get_player_app_value_cb,
.get_player_app_values_text_cb = get_player_app_values_text_cb,
.set_player_app_value_cb = set_player_app_value_cb,
.get_element_attr_cb = get_element_attr_cb,
--
1.8.3.2


2014-03-18 13:29:55

by Ravi kumar Veeramally

[permalink] [raw]
Subject: [PATCH_v2 4/8] android/client: Add AVRCP get_player_app_values_text_cb support

---
android/client/if-rc.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index dec815c..03fad8f 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -68,6 +68,13 @@ static void get_play_status_cb(void)
haltest_info("%s\n", __func__);
}

+static void get_player_app_values_text_cb(uint8_t attr_id, uint8_t num_val,
+ uint8_t *p_vals)
+{
+ haltest_info("%s, attr_id=%d num_val=%d values=%p\n", __func__,
+ attr_id, num_val, p_vals);
+}
+
static void set_player_app_value_cb(btrc_player_settings_t *p_vals)
{
int i;
@@ -108,6 +115,7 @@ static btrc_callbacks_t rc_cbacks = {
.size = sizeof(rc_cbacks),
.remote_features_cb = remote_features_cb,
.get_play_status_cb = get_play_status_cb,
+ .get_player_app_values_text_cb = get_player_app_values_text_cb,
.set_player_app_value_cb = set_player_app_value_cb,
.get_element_attr_cb = get_element_attr_cb,
.register_notification_cb = register_notification_cb,
--
1.8.3.2


2014-03-18 13:29:54

by Ravi kumar Veeramally

[permalink] [raw]
Subject: [PATCH_v2 3/8] android/client: Add AVRCP set_player_app_value_cb support

---
android/client/if-rc.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index f1cdbc5..dec815c 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -68,6 +68,17 @@ static void get_play_status_cb(void)
haltest_info("%s\n", __func__);
}

+static void set_player_app_value_cb(btrc_player_settings_t *p_vals)
+{
+ int i;
+
+ haltest_info("%s, num_attr=%u\n", __func__, p_vals->num_attr);
+
+ for (i = 0; i < p_vals->num_attr; i++)
+ haltest_info("attr id=%u, values=%u\n", p_vals->attr_ids[i],
+ p_vals->attr_values[i]);
+}
+
static void get_element_attr_cb(uint8_t num_attr, btrc_media_attr_t *attrs)
{
uint8_t i;
@@ -97,6 +108,7 @@ static btrc_callbacks_t rc_cbacks = {
.size = sizeof(rc_cbacks),
.remote_features_cb = remote_features_cb,
.get_play_status_cb = get_play_status_cb,
+ .set_player_app_value_cb = set_player_app_value_cb,
.get_element_attr_cb = get_element_attr_cb,
.register_notification_cb = register_notification_cb,
.volume_change_cb = volume_change_cb,
--
1.8.3.2


2014-03-18 13:29:53

by Ravi kumar Veeramally

[permalink] [raw]
Subject: [PATCH_v2 2/8] android/client: Add AVRCP passthrough_cmd_cb support

---
android/client/if-rc.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index 2e93c02..f1cdbc5 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -88,6 +88,11 @@ static void volume_change_cb(uint8_t volume, uint8_t ctype)
haltest_info("%s, volume=%d ctype=%d\n", __func__, volume, ctype);
}

+static void passthrough_cmd_cb(int id, int key_state)
+{
+ haltest_info("%s, id=%d key_state=%d\n", __func__, id, key_state);
+}
+
static btrc_callbacks_t rc_cbacks = {
.size = sizeof(rc_cbacks),
.remote_features_cb = remote_features_cb,
@@ -95,6 +100,7 @@ static btrc_callbacks_t rc_cbacks = {
.get_element_attr_cb = get_element_attr_cb,
.register_notification_cb = register_notification_cb,
.volume_change_cb = volume_change_cb,
+ .passthrough_cmd_cb = passthrough_cmd_cb,
};

/* init */
--
1.8.3.2