linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Initial HAL test AVRCP api support
@ 2014-02-28 18:58 Ravi kumar Veeramally
  2014-02-28 18:58 ` [PATCH 1/6] android/client: Add AVRCP get_play_status_rsp support Ravi kumar Veeramally
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Ravi kumar Veeramally @ 2014-02-28 18:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ravi kumar Veeramally

Patchset contains initial AVRCP api support for HAL test.

Ravi kumar Veeramally (6):
  android/client: Add AVRCP get_play_status_rsp support
  android/client: Add AVRCP get_element_attr_rsp support
  android/client: Add AVRCP set_volume support
  android/client: Add AVRCP get_play_status_cb support
  android/client: Add AVRCP get_element_attr_cb support
  android/client: Add AVRCP volume_change_cb support

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

-- 
1.8.3.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/6] android/client: Add AVRCP get_play_status_rsp support
  2014-02-28 18:58 [PATCH 0/6] Initial HAL test AVRCP api support Ravi kumar Veeramally
@ 2014-02-28 18:58 ` Ravi kumar Veeramally
  2014-02-28 18:58 ` [PATCH 2/6] android/client: Add AVRCP get_element_attr_rsp support Ravi kumar Veeramally
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Ravi kumar Veeramally @ 2014-02-28 18:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ravi kumar Veeramally

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

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index 58fb892..7da26e6 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -15,11 +15,27 @@
  *
  */
 
+#include<stdio.h>
+#include<ctype.h>
+
+#include<hardware/bluetooth.h>
+#include<hardware/bt_hh.h>
+
 #include "if-main.h"
+#include "pollhandler.h"
 #include "../hal-utils.h"
 
 const btrc_interface_t *if_rc = NULL;
 
+SINTMAP(btrc_play_status_t, -1, "(unknown)")
+	DELEMENT(BTRC_PLAYSTATE_STOPPED),
+	DELEMENT(BTRC_PLAYSTATE_PLAYING),
+	DELEMENT(BTRC_PLAYSTATE_PAUSED),
+	DELEMENT(BTRC_PLAYSTATE_FWD_SEEK),
+	DELEMENT(BTRC_PLAYSTATE_REV_SEEK),
+	DELEMENT(BTRC_PLAYSTATE_ERROR),
+ENDMAP
+
 static btrc_callbacks_t rc_cbacks = {
 	.size = sizeof(rc_cbacks),
 };
@@ -33,6 +49,46 @@ static void init_p(int argc, const char **argv)
 	EXEC(if_rc->init, &rc_cbacks);
 }
 
+/* get_play_status_rsp */
+
+static void get_play_status_rsp_c(int argc, const char **argv,
+					enum_func *enum_func, void **user)
+{
+	if (argc == 3) {
+		*user = TYPE_ENUM(btrc_play_status_t);
+		*enum_func = enum_defines;
+	}
+}
+
+static void get_play_status_rsp_p(int argc, const char **argv)
+{
+	btrc_play_status_t play_status;
+	uint32_t song_len, song_pos;
+
+	RETURN_IF_NULL(if_rc);
+
+	if (argc <= 2) {
+		haltest_error("No play status specified");
+		return;
+	}
+
+	if (argc <= 3) {
+		haltest_error("No song length specified");
+		return;
+	}
+
+	if (argc <= 4) {
+		haltest_error("No song position specified");
+		return;
+	}
+
+	play_status = str2btrc_play_status_t(argv[2]);
+	song_len = (uint32_t) atoi(argv[3]);
+	song_pos = (uint32_t) atoi(argv[4]);
+
+	EXEC(if_rc->get_play_status_rsp, play_status, song_len, song_pos);
+}
+
 /* cleanup */
 
 static void cleanup_p(int argc, const char **argv)
@@ -45,6 +101,8 @@ static void cleanup_p(int argc, const char **argv)
 
 static struct method methods[] = {
 	STD_METHOD(init),
+	STD_METHODCH(get_play_status_rsp,
+					"<play_status> <song_len> <song_pos>"),
 	STD_METHOD(cleanup),
 	END_METHOD
 };
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/6] android/client: Add AVRCP get_element_attr_rsp support
  2014-02-28 18:58 [PATCH 0/6] Initial HAL test AVRCP api support Ravi kumar Veeramally
  2014-02-28 18:58 ` [PATCH 1/6] android/client: Add AVRCP get_play_status_rsp support Ravi kumar Veeramally
@ 2014-02-28 18:58 ` Ravi kumar Veeramally
  2014-02-28 18:58 ` [PATCH 3/6] android/client: Add AVRCP set_volume support Ravi kumar Veeramally
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Ravi kumar Veeramally @ 2014-02-28 18:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ravi kumar Veeramally

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

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index 7da26e6..5625e56 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -36,6 +36,16 @@ SINTMAP(btrc_play_status_t, -1, "(unknown)")
 	DELEMENT(BTRC_PLAYSTATE_ERROR),
 ENDMAP
 
+SINTMAP(btrc_media_attr_t, -1, "(unknown)")
+	DELEMENT(BTRC_MEDIA_ATTR_TITLE),
+	DELEMENT(BTRC_MEDIA_ATTR_ARTIST),
+	DELEMENT(BTRC_MEDIA_ATTR_ALBUM),
+	DELEMENT(BTRC_MEDIA_ATTR_TRACK_NUM),
+	DELEMENT(BTRC_MEDIA_ATTR_NUM_TRACKS),
+	DELEMENT(BTRC_MEDIA_ATTR_GENRE),
+	DELEMENT(BTRC_MEDIA_ATTR_PLAYING_TIME),
+ENDMAP
+
 static btrc_callbacks_t rc_cbacks = {
 	.size = sizeof(rc_cbacks),
 };
@@ -89,6 +99,41 @@ static void get_play_status_rsp_p(int argc, const char **argv)
 	EXEC(if_rc->get_play_status_rsp, play_status, song_len, song_pos);
 }
 
+/* get_element_attr_rsp */
+
+static void get_element_attr_rsp_c(int argc, const char **argv,
+					enum_func *enum_func, void **user)
+{
+	if (argc == 4) {
+		*user = TYPE_ENUM(btrc_media_attr_t);
+		*enum_func = enum_defines;
+	}
+}
+
+static void get_element_attr_rsp_p(int argc, const char **argv)
+{
+	uint8_t num_attr;
+	btrc_element_attr_val_t attrs;
+
+	RETURN_IF_NULL(if_rc);
+
+	if (argc <= 2) {
+		haltest_error("No number of attributes specified");
+		return;
+	}
+
+	if (argc <= 4) {
+		haltest_error("No attr id and value specified");
+		return;
+	}
+
+	num_attr = (uint8_t) atoi(argv[2]);
+	attrs.attr_id = str2btrc_media_attr_t(argv[3]);
+	strcpy((char *)attrs.text, argv[4]);
+
+	EXEC(if_rc->get_element_attr_rsp, num_attr, &attrs);
+}
+
 /* cleanup */
 
 static void cleanup_p(int argc, const char **argv)
@@ -103,6 +148,7 @@ static struct method methods[] = {
 	STD_METHOD(init),
 	STD_METHODCH(get_play_status_rsp,
 					"<play_status> <song_len> <song_pos>"),
+	STD_METHODCH(get_element_attr_rsp, "<num_attr> <attrs_id> <value>"),
 	STD_METHOD(cleanup),
 	END_METHOD
 };
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/6] android/client: Add AVRCP set_volume support
  2014-02-28 18:58 [PATCH 0/6] Initial HAL test AVRCP api support Ravi kumar Veeramally
  2014-02-28 18:58 ` [PATCH 1/6] android/client: Add AVRCP get_play_status_rsp support Ravi kumar Veeramally
  2014-02-28 18:58 ` [PATCH 2/6] android/client: Add AVRCP get_element_attr_rsp support Ravi kumar Veeramally
@ 2014-02-28 18:58 ` Ravi kumar Veeramally
  2014-02-28 18:58 ` [PATCH 4/6] android/client: Add AVRCP get_play_status_cb support Ravi kumar Veeramally
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Ravi kumar Veeramally @ 2014-02-28 18:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ravi kumar Veeramally

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

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index 5625e56..5aab8e0 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -134,6 +134,29 @@ static void get_element_attr_rsp_p(int argc, const char **argv)
 	EXEC(if_rc->get_element_attr_rsp, num_attr, &attrs);
 }
 
+/* set_volume */
+
+static void set_volume_c(int argc, const char **argv,
+					enum_func *enum_func, void **user)
+{
+}
+
+static void set_volume_p(int argc, const char **argv)
+{
+	uint8_t volume;
+
+	RETURN_IF_NULL(if_rc);
+
+	if (argc <= 2) {
+		haltest_error("No volume specified");
+		return;
+	}
+
+	volume = (uint8_t) atoi(argv[2]);
+
+	EXEC(if_rc->set_volume, volume);
+}
+
 /* cleanup */
 
 static void cleanup_p(int argc, const char **argv)
@@ -149,6 +172,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_volume, "<volume>"),
 	STD_METHOD(cleanup),
 	END_METHOD
 };
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/6] android/client: Add AVRCP get_play_status_cb support
  2014-02-28 18:58 [PATCH 0/6] Initial HAL test AVRCP api support Ravi kumar Veeramally
                   ` (2 preceding siblings ...)
  2014-02-28 18:58 ` [PATCH 3/6] android/client: Add AVRCP set_volume support Ravi kumar Veeramally
@ 2014-02-28 18:58 ` Ravi kumar Veeramally
  2014-02-28 18:58 ` [PATCH 5/6] android/client: Add AVRCP get_element_attr_cb support Ravi kumar Veeramally
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Ravi kumar Veeramally @ 2014-02-28 18:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ravi kumar Veeramally

---
 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 5aab8e0..b8174dd 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -46,8 +46,14 @@ SINTMAP(btrc_media_attr_t, -1, "(unknown)")
 	DELEMENT(BTRC_MEDIA_ATTR_PLAYING_TIME),
 ENDMAP
 
+static void get_play_status_cb(void)
+{
+	haltest_info("%s", __func__);
+}
+
 static btrc_callbacks_t rc_cbacks = {
 	.size = sizeof(rc_cbacks),
+	.get_play_status_cb = get_play_status_cb,
 };
 
 /* init */
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/6] android/client: Add AVRCP get_element_attr_cb support
  2014-02-28 18:58 [PATCH 0/6] Initial HAL test AVRCP api support Ravi kumar Veeramally
                   ` (3 preceding siblings ...)
  2014-02-28 18:58 ` [PATCH 4/6] android/client: Add AVRCP get_play_status_cb support Ravi kumar Veeramally
@ 2014-02-28 18:58 ` Ravi kumar Veeramally
  2014-02-28 18:58 ` [PATCH 6/6] android/client: Add AVRCP volume_change_cb support Ravi kumar Veeramally
  2014-03-02 18:57 ` [PATCH 0/6] Initial HAL test AVRCP api support Luiz Augusto von Dentz
  6 siblings, 0 replies; 9+ messages in thread
From: Ravi kumar Veeramally @ 2014-02-28 18:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ravi kumar Veeramally

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

diff --git a/android/client/if-rc.c b/android/client/if-rc.c
index b8174dd..57f7082 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -51,9 +51,20 @@ static void get_play_status_cb(void)
 	haltest_info("%s", __func__);
 }
 
+static void get_element_attr_cb(uint8_t num_attr, btrc_media_attr_t *attrs)
+{
+	uint8_t i;
+
+	haltest_info("%s, num_of_attributes=%d", __func__, num_attr);
+
+	for (i = 0; i < num_attr; i++)
+		haltest_info("attr id=%s", btrc_media_attr_t2str(attrs[i]));
+}
+
 static btrc_callbacks_t rc_cbacks = {
 	.size = sizeof(rc_cbacks),
 	.get_play_status_cb = get_play_status_cb,
+	.get_element_attr_cb = get_element_attr_cb,
 };
 
 /* init */
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/6] android/client: Add AVRCP volume_change_cb support
  2014-02-28 18:58 [PATCH 0/6] Initial HAL test AVRCP api support Ravi kumar Veeramally
                   ` (4 preceding siblings ...)
  2014-02-28 18:58 ` [PATCH 5/6] android/client: Add AVRCP get_element_attr_cb support Ravi kumar Veeramally
@ 2014-02-28 18:58 ` Ravi kumar Veeramally
  2014-03-02 18:57 ` [PATCH 0/6] Initial HAL test AVRCP api support Luiz Augusto von Dentz
  6 siblings, 0 replies; 9+ messages in thread
From: Ravi kumar Veeramally @ 2014-02-28 18:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ravi kumar Veeramally

---
 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 57f7082..02e1de3 100644
--- a/android/client/if-rc.c
+++ b/android/client/if-rc.c
@@ -61,10 +61,16 @@ static void get_element_attr_cb(uint8_t num_attr, btrc_media_attr_t *attrs)
 		haltest_info("attr id=%s", btrc_media_attr_t2str(attrs[i]));
 }
 
+static void volume_change_cb(uint8_t volume, uint8_t ctype)
+{
+	haltest_info("%s, volume=%d ctype=%d", __func__, volume, ctype);
+}
+
 static btrc_callbacks_t rc_cbacks = {
 	.size = sizeof(rc_cbacks),
 	.get_play_status_cb = get_play_status_cb,
 	.get_element_attr_cb = get_element_attr_cb,
+	.volume_change_cb = volume_change_cb,
 };
 
 /* init */
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/6] Initial HAL test AVRCP api support
  2014-02-28 18:58 [PATCH 0/6] Initial HAL test AVRCP api support Ravi kumar Veeramally
                   ` (5 preceding siblings ...)
  2014-02-28 18:58 ` [PATCH 6/6] android/client: Add AVRCP volume_change_cb support Ravi kumar Veeramally
@ 2014-03-02 18:57 ` Luiz Augusto von Dentz
  2014-03-04 11:48   ` Luiz Augusto von Dentz
  6 siblings, 1 reply; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2014-03-02 18:57 UTC (permalink / raw)
  To: Ravi kumar Veeramally; +Cc: linux-bluetooth@vger.kernel.org

Hi Ravi,

On Fri, Feb 28, 2014 at 8:58 PM, Ravi kumar Veeramally
<ravikumar.veeramally@linux.intel.com> wrote:
> Patchset contains initial AVRCP api support for HAL test.
>
> Ravi kumar Veeramally (6):
>   android/client: Add AVRCP get_play_status_rsp support
>   android/client: Add AVRCP get_element_attr_rsp support
>   android/client: Add AVRCP set_volume support
>   android/client: Add AVRCP get_play_status_cb support
>   android/client: Add AVRCP get_element_attr_cb support
>   android/client: Add AVRCP volume_change_cb support
>
>  android/client/if-rc.c | 151 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 151 insertions(+)
>
> --
> 1.8.3.2

This doesn't help much with AVRCP since the requests need to be
responded rather quickly we might need to have them auto responded if
we really want hal-tester to be usable.


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/6] Initial HAL test AVRCP api support
  2014-03-02 18:57 ` [PATCH 0/6] Initial HAL test AVRCP api support Luiz Augusto von Dentz
@ 2014-03-04 11:48   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2014-03-04 11:48 UTC (permalink / raw)
  To: Ravi kumar Veeramally; +Cc: linux-bluetooth@vger.kernel.org

Hi Ravi,

On Sun, Mar 2, 2014 at 8:57 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> Hi Ravi,
>
> On Fri, Feb 28, 2014 at 8:58 PM, Ravi kumar Veeramally
> <ravikumar.veeramally@linux.intel.com> wrote:
>> Patchset contains initial AVRCP api support for HAL test.
>>
>> Ravi kumar Veeramally (6):
>>   android/client: Add AVRCP get_play_status_rsp support
>>   android/client: Add AVRCP get_element_attr_rsp support
>>   android/client: Add AVRCP set_volume support
>>   android/client: Add AVRCP get_play_status_cb support
>>   android/client: Add AVRCP get_element_attr_cb support
>>   android/client: Add AVRCP volume_change_cb support
>>
>>  android/client/if-rc.c | 151 +++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 151 insertions(+)
>>
>> --
>> 1.8.3.2
>
> This doesn't help much with AVRCP since the requests need to be
> responded rather quickly we might need to have them auto responded if
> we really want hal-tester to be usable.

Applied, it turn out to be useful while testing but I did need to add
\n in a few places.


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-03-04 11:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-28 18:58 [PATCH 0/6] Initial HAL test AVRCP api support Ravi kumar Veeramally
2014-02-28 18:58 ` [PATCH 1/6] android/client: Add AVRCP get_play_status_rsp support Ravi kumar Veeramally
2014-02-28 18:58 ` [PATCH 2/6] android/client: Add AVRCP get_element_attr_rsp support Ravi kumar Veeramally
2014-02-28 18:58 ` [PATCH 3/6] android/client: Add AVRCP set_volume support Ravi kumar Veeramally
2014-02-28 18:58 ` [PATCH 4/6] android/client: Add AVRCP get_play_status_cb support Ravi kumar Veeramally
2014-02-28 18:58 ` [PATCH 5/6] android/client: Add AVRCP get_element_attr_cb support Ravi kumar Veeramally
2014-02-28 18:58 ` [PATCH 6/6] android/client: Add AVRCP volume_change_cb support Ravi kumar Veeramally
2014-03-02 18:57 ` [PATCH 0/6] Initial HAL test AVRCP api support Luiz Augusto von Dentz
2014-03-04 11:48   ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).