[PATCH BlueZ 2/8] unit/test-gatt: Add support for no-actions

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

 



With some tests (specifically notification / indication tests), the
client sets up a condition and then the server does something without
a message from the client.  This patch makes it possible to add a
zero-length PDU which indicates that no message is expected from the
client after a server response.
---
 unit/test-gatt.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index cd90d83..7bc2168 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -250,6 +250,15 @@ static gboolean send_pdu(gpointer user_data)
 	g_assert_cmpint(len, ==, pdu->size);
 
 	context->process = 0;
+
+	pdu = &context->data->pdu_list[context->pdu_offset];
+	if (pdu->valid && (pdu->size == 0)) {
+		if (g_test_verbose())
+			test_debug("(no action expected)", "GATT: ");
+		context->pdu_offset++;
+		return send_pdu(context);
+	}
+
 	return FALSE;
 }
 
-- 
2.2.0.rc0.207.ga3a616c

--
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