From 29d3fdcaf93bd29842028f9b6cc259ce5732d3f5 Mon Sep 17 00:00:00 2001 From: Marcin Kraglak Date: Thu, 6 Nov 2014 13:47:07 +0100 Subject: [PATCH] unit/test-gatt: Add TP/GAD/CL/BV-06-C test Verify that a Generic Attribute Profile client can find all Descriptors of a specified Characteristic. --- unit/test-gatt.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/unit/test-gatt.c b/unit/test-gatt.c index f343fe655..a2ca5b6f5 100644 --- a/unit/test-gatt.c +++ b/unit/test-gatt.c @@ -334,6 +334,17 @@ static void test_search_chars(gconstpointer data) execute_context(context); } +static void test_search_descs(gconstpointer data) +{ + struct context *context = create_context(512, data); + + g_assert(bt_gatt_discover_descriptors(context->att, 0x0013, 0x0016, + generic_search_cb, + context, NULL)); + + execute_context(context); +} + int main(int argc, char *argv[]) { g_test_init(&argc, &argv, NULL); @@ -429,5 +440,15 @@ int main(int argc, char *argv[]) raw_pdu(0x08, 0x14, 0x00, 0x20, 0x00, 0x03, 0x28), raw_pdu(0x01, 0x08, 0x12, 0x00, 0x0a)); + define_test("/TP/GAD/CL/BV-06-C", test_search_descs, ATT, NULL, + raw_pdu(0x02, 0x00, 0x02), + raw_pdu(0x03, 0x00, 0x02), + raw_pdu(0x04, 0x13, 0x00, 0x16, 0x00), + raw_pdu(0x05, 0x01, 0x13, 0x00, 0x02, 0x29, 0x14, 0x00, + 0x03, 0x29), + raw_pdu(0x04, 0x15, 0x00, 0x16, 0x00), + raw_pdu(0x05, 0x01, 0x15, 0x00, 0x04, 0x29, 0x16, 0x00, + 0x05, 0x29)); + return g_test_run(); } -- 2.47.3