From ea331a25f85dc8de35c636892ffb03b0b8a52e32 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 24 Oct 2014 17:30:50 +0300 Subject: [PATCH] unit/test-avrcp: Add /TP/PTH/BV-01-C test Verify the state flag in the PASS THROUGH command is correctly set to convey the button action. --- unit/test-avrcp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c index 7f288a8d0..d0b1c367d 100644 --- a/unit/test-avrcp.c +++ b/unit/test-avrcp.c @@ -1073,6 +1073,9 @@ static void test_client(gconstpointer data) avrcp_register_notification(context->session, AVRCP_EVENT_VOLUME_CHANGED, 0); + if (g_str_equal(context->data->test_name, "/TP/PTH/BV-01-C")) + avrcp_send_passthrough(context->session, 0, AVC_PLAY); + execute_context(context); } @@ -2109,6 +2112,17 @@ int main(int argc, char *argv[]) 0x00, 0x00, 0x02, 0x0d, 0x81)); + /* PASS THROUGH Handling */ + + /* Press and release – CT */ + define_test("/TP/PTH/BV-01-C", test_client, + raw_pdu(0x00, 0x11, 0x0e, 0x00, 0x48, + AVC_OP_PASSTHROUGH, AVC_PLAY, 0x00), + raw_pdu(0x02, 0x11, 0x0e, AVC_CTYPE_ACCEPTED, 0x48, + AVC_OP_PASSTHROUGH, AVC_PLAY), + raw_pdu(0x10, 0x11, 0x0e, 0x00, 0x48, + AVC_OP_PASSTHROUGH, AVC_PLAY | 0x80, 0x00)); + /* Request continuing response - TG */ define_test("/TP/RCR/BV-02-C", test_server, raw_pdu(0x00, 0x11, 0x0e, 0x01, 0x48, 0x00, -- 2.47.3