Diff between 3651a17f88b2da213c2f0482d3a7fb80e5dc4444 and 44b3d5e4809e2bbfa5d9d336fdb96749280c3e5c

Changed Files

File Additions Deletions Status
tools/l2cap-tester.c +17 -0 modified

Full Patch

diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c
index 9670a9a..505ac79 100644
--- a/tools/l2cap-tester.c
+++ b/tools/l2cap-tester.c
@@ -325,6 +325,21 @@ static const struct l2cap_client_data le_client_connect_nval_psm_test = {
 	.expect_err = ECONNREFUSED,
 };
 
+static const uint8_t le_connect_req[] = {	0x80, 0x00, /* PSM */
+						0x41, 0x00, /* SCID */
+						0x20, 0x00, /* MTU */
+						0x20, 0x00, /* MPS */
+						0x05, 0x00, /* Credits */
+};
+
+static const struct l2cap_server_data le_server_success_test = {
+	.server_psm = 0x0080,
+	.send_req_code = BT_L2CAP_PDU_LE_CONN_REQ,
+	.send_req = le_connect_req,
+	.send_req_len = sizeof(le_connect_req),
+	.expect_rsp_code = BT_L2CAP_PDU_LE_CONN_RSP,
+};
+
 static void client_connectable_complete(uint16_t opcode, uint8_t status,
 					const void *param, uint8_t len,
 					void *user_data)
@@ -753,6 +768,8 @@ int main(int argc, char *argv[])
 	test_l2cap_le("L2CAP LE Client - Invalid PSM",
 					&le_client_connect_nval_psm_test,
 					setup_powered_client, test_connect);
+	test_l2cap_le("L2CAP LE Server - Success", &le_server_success_test,
+					setup_powered_server, test_server);
 
 	return tester_run();
 }