[PATCHv3 6/7] unit/test-gatt: Add TP/GAD/CL/BV-03-C test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Verify that a Generic Attribute Profile client
can find include service declarations within
a specified service definition on a server.
---
 unit/test-gatt.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 239f471..3ee9460 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -270,6 +270,17 @@ static void primary_cb(bool success, uint8_t att_ecode,
 	context_quit(context);
 }
 
+static void included_cb(bool success, uint8_t att_ecode,
+						struct bt_gatt_result *result,
+						void *user_data)
+{
+	struct context *context = user_data;
+
+	g_assert(success);
+
+	context_quit(context);
+}
+
 static void destroy_context(struct context *context)
 {
 	if (context->source > 0)
@@ -311,6 +322,16 @@ static void test_search_primary(gconstpointer data)
 	execute_context(context);
 }
 
+static void test_search_included(gconstpointer data)
+{
+	struct context *context = create_context(512, data);
+
+	bt_gatt_discover_included_services(context->att, 0x0001, 0xffff,
+						included_cb, context, NULL);
+
+	execute_context(context);
+}
+
 int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
@@ -369,5 +390,28 @@ int main(int argc, char *argv[])
 					0x18, 0x00, 0x00),
 			raw_pdu(0x01, 0x06, 0x08, 0x00, 0x0a));
 
+	define_test("/TP/GAD/CL/BV-03-C", test_search_included, ATT, NULL,
+			raw_pdu(0x02, 0x00, 0x02),
+			raw_pdu(0x03, 0x00, 0x02),
+			raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x02, 0x28),
+			raw_pdu(0x09, 0x08, 0x02, 0x00, 0x10, 0x00, 0x1f, 0x00,
+					0x0f, 0x18),
+			raw_pdu(0x08, 0x03, 0x00, 0xff, 0xff, 0x02, 0x28),
+			raw_pdu(0x09, 0x06, 0x03, 0x00, 0x20, 0x00, 0x2f, 0x00,
+					0x04, 0x00, 0x30, 0x00, 0x3f, 0x00),
+			raw_pdu(0x0a, 0x20, 0x00),
+			raw_pdu(0x0b, 0x00, 0x00, 0x3e, 0x39, 0x00, 0x00, 0x00,
+					0x00, 0x01, 0x23, 0x45, 0x67, 0x89,
+					0xab, 0xcd, 0xef),
+			raw_pdu(0x0a, 0x30, 0x00),
+			raw_pdu(0x0b, 0x00, 0x00, 0x3b, 0x39, 0x00, 0x00, 0x00,
+					0x00, 0x01, 0x23, 0x45, 0x67, 0x89,
+					0xab, 0xcd, 0xef),
+			raw_pdu(0x08, 0x05, 0x00, 0xff, 0xff, 0x02, 0x28),
+			raw_pdu(0x09, 0x08, 0x05, 0x00, 0x40, 0x00, 0x4f, 0x00,
+								0x0a, 0x18),
+			raw_pdu(0x08, 0x06, 0x00, 0xff, 0xff, 0x02, 0x28),
+			raw_pdu(0x01, 0x08, 0x06, 0x00, 0x0a));
+
 	return g_test_run();
 }
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux