2014-02-27 13:35:10

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH 1/4] unit/avrcp: Add /TP/PAS/BV-02-C test

From: Andrei Emeltchenko <[email protected]>

Test verifies that the List Player Application Setting Attributes
response issued from the Target.
---
unit/test-avrcp.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index c65f743..c4faca3 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -331,9 +331,23 @@ fail:
return AVC_CTYPE_REJECTED;
}

+static uint8_t avrcp_handle_list_attributes(struct avrcp *session,
+ uint8_t transaction, uint16_t *params_len,
+ uint8_t *params, void *user_data)
+{
+ DBG("");
+
+ *params_len = 1;
+ params[0] = 0;
+
+ return AVC_CTYPE_STABLE;
+}
+
static const struct avrcp_control_handler control_handlers[] = {
{ AVRCP_GET_CAPABILITIES, AVC_CTYPE_STATUS,
avrcp_handle_get_capabilities },
+ { AVRCP_LIST_PLAYER_ATTRIBUTES, AVC_CTYPE_STATUS,
+ avrcp_handle_list_attributes },
{ },
};

@@ -462,5 +476,13 @@ int main(int argc, char *argv[])
0x00, 0x19, 0x58, 0x11, 0x00, 0x00,
0x00));

+ define_test("/TP/PAS/BV-02-C", test_server,
+ raw_pdu(0x00, 0x11, 0x0e, 0x01, 0x48, 0x00,
+ 0x00, 0x19, 0x58, 0x11, 0x00, 0x00,
+ 0x00),
+ raw_pdu(0x02, 0x11, 0x0e, 0x0c, 0x48, 0x00,
+ 0x00, 0x19, 0x58, 0x11, 0x00, 0x00,
+ 0x01, 0x00));
+
return g_test_run();
}
--
1.8.3.2



2014-02-27 13:35:13

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH 4/4] unit/avrcp: Add /TP/PAS/BV-04-C test

From: Andrei Emeltchenko <[email protected]>

Test verifies that the Get Player Application Setting Attribute Text
response issued from the Target.
---
unit/test-avrcp.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index a75165b..db9cb92 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -343,11 +343,25 @@ static uint8_t avrcp_handle_list_attributes(struct avrcp *session,
return AVC_CTYPE_STABLE;
}

+static uint8_t avrcp_handle_get_player_attr_text(struct avrcp *session,
+ uint8_t transaction, uint16_t *params_len,
+ uint8_t *params, void *user_data)
+{
+ DBG("");
+
+ *params_len = 1;
+ params[0] = 0;
+
+ return AVC_CTYPE_STABLE;
+}
+
static const struct avrcp_control_handler control_handlers[] = {
{ AVRCP_GET_CAPABILITIES, AVC_CTYPE_STATUS,
avrcp_handle_get_capabilities },
{ AVRCP_LIST_PLAYER_ATTRIBUTES, AVC_CTYPE_STATUS,
avrcp_handle_list_attributes },
+ { AVRCP_GET_PLAYER_ATTRIBUTE_TEXT, AVC_CTYPE_STATUS,
+ avrcp_handle_get_player_attr_text },
{ },
};

@@ -494,5 +508,15 @@ int main(int argc, char *argv[])
AVRCP_GET_PLAYER_ATTRIBUTE_TEXT,
0x00, 0x00, 0x00));

+ define_test("/TP/PAS/BV-04-C", test_server,
+ raw_pdu(0x00, 0x11, 0x0e, 0x01, 0x48, 0x00,
+ 0x00, 0x19, 0x58,
+ AVRCP_GET_PLAYER_ATTRIBUTE_TEXT,
+ 0x00, 0x00, 0x00),
+ raw_pdu(0x02, 0x11, 0x0e, 0x0c, 0x48, 0x00,
+ 0x00, 0x19, 0x58,
+ AVRCP_GET_PLAYER_ATTRIBUTE_TEXT,
+ 0x00, 0x00, 0x01, 0x00));
+
return g_test_run();
}
--
1.8.3.2


2014-02-27 13:35:11

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH 2/4] android/avrcp: Implement get player attributes text

From: Andrei Emeltchenko <[email protected]>

---
android/avrcp-lib.c | 9 +++++++++
android/avrcp-lib.h | 3 +++
2 files changed, 12 insertions(+)

diff --git a/android/avrcp-lib.c b/android/avrcp-lib.c
index 3db5bda..52074a7 100644
--- a/android/avrcp-lib.c
+++ b/android/avrcp-lib.c
@@ -312,3 +312,12 @@ int avrcp_list_player_attributes(struct avrcp *session, avctp_rsp_cb func,
AVRCP_LIST_PLAYER_ATTRIBUTES, NULL, 0,
func, user_data);
}
+
+int avrcp_get_player_attribute_text(struct avrcp *session, uint8_t *attributes,
+ uint8_t attr_len, avctp_rsp_cb func,
+ void *user_data)
+{
+ return avrcp_send_req(session, AVC_CTYPE_STATUS, AVC_SUBUNIT_PANEL,
+ AVRCP_GET_PLAYER_ATTRIBUTE_TEXT, attributes,
+ attr_len, func, user_data);
+}
diff --git a/android/avrcp-lib.h b/android/avrcp-lib.h
index 7283203..da8c990 100644
--- a/android/avrcp-lib.h
+++ b/android/avrcp-lib.h
@@ -110,3 +110,6 @@ int avrcp_get_capabilities(struct avrcp *session, uint8_t param,
avctp_rsp_cb func, void *user_data);
int avrcp_list_player_attributes(struct avrcp *session, avctp_rsp_cb func,
void *user_data);
+int avrcp_get_player_attribute_text(struct avrcp *session, uint8_t *attributes,
+ uint8_t attr_len, avctp_rsp_cb func,
+ void *user_data);
--
1.8.3.2


2014-02-27 13:35:12

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH 3/4] unit/avrcp: Add /TP/PAS/BV-03-C test

From: Andrei Emeltchenko <[email protected]>

Test verifies that the get player application settings attribute text
command issued from the Controller.
---
unit/test-avrcp.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index c4faca3..a75165b 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -375,6 +375,10 @@ static void test_client(gconstpointer data)
if (g_str_equal(context->data->test_name, "/TP/PAS/BV-01-C"))
avrcp_list_player_attributes(context->session, NULL, NULL);

+ if (g_str_equal(context->data->test_name, "/TP/PAS/BV-03-C"))
+ avrcp_get_player_attribute_text(context->session, NULL, 0,
+ NULL, NULL);
+
execute_context(context);
}

@@ -484,5 +488,11 @@ int main(int argc, char *argv[])
0x00, 0x19, 0x58, 0x11, 0x00, 0x00,
0x01, 0x00));

+ define_test("/TP/PAS/BV-03-C", test_client,
+ raw_pdu(0x00, 0x11, 0x0e, 0x01, 0x48, 0x00,
+ 0x00, 0x19, 0x58,
+ AVRCP_GET_PLAYER_ATTRIBUTE_TEXT,
+ 0x00, 0x00, 0x00));
+
return g_test_run();
}
--
1.8.3.2