From 26d58e7767291469ab8bee4ba4a7624f9c48687e Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Mon, 24 Feb 2014 15:25:17 +0200 Subject: [PATCH] unit/avrcp: Add /TP/PTT/BV-01-I test Test verifies that the Target reacts to the PASS THROUGH command in category 1 from the Controller. The command chosen is PLAY (0x44). --- unit/test-avrcp.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c index e9fe7e306..9bd27da71 100644 --- a/unit/test-avrcp.c +++ b/unit/test-avrcp.c @@ -249,10 +249,23 @@ static void execute_context(struct context *context) destroy_context(context); } +static bool handle_play(struct avrcp *session) +{ + return true; +} + +static const struct avrcp_passthrough_handler passthrough_handlers[] = { + { AVC_PLAY, handle_play }, + { }, +}; + static void test_server(gconstpointer data) { struct context *context = create_context(0x0100, data); + avrcp_set_passthrough_handlers(context->session, passthrough_handlers, + context); + g_idle_add(send_pdu, context); execute_context(context); @@ -291,5 +304,11 @@ int main(int argc, char *argv[]) raw_pdu(0x02, 0x11, 0x0e, 0x0c, 0xf8, 0x31, 0x07, 0x48, 0xff, 0xff, 0xff)); + define_test("/TP/PTT/BV-01-I", test_server, + raw_pdu(0x00, 0x11, 0x0e, 0x00, 0x48, 0x7c, + 0x44, 0x00), + raw_pdu(0x02, 0x11, 0x0e, 0x09, 0x48, 0x7c, + 0x44, 0x00)); + return g_test_run(); } -- 2.47.3