Diff between 347bb9cad49e0cd9aa94c67c5f6027cbb9c0ee6c and d6d3d26bdadb6202b5993a2685137a9f21ba55de

Changed Files

File Additions Deletions Status
tools/smp-tester.c +15 -12 modified

Full Patch

diff --git a/tools/smp-tester.c b/tools/smp-tester.c
index b1d25a3..45c4d8b 100644
--- a/tools/smp-tester.c
+++ b/tools/smp-tester.c
@@ -640,20 +640,23 @@ static void smp_server(const void *data, uint16_t len, void *user_data)
 	}
 
 next:
-	if (smp->req_count == test_data->counter) {
-		test_condition_complete(test_data);
-		return;
+	while (true) {
+		if (smp->req_count == test_data->counter) {
+			test_condition_complete(test_data);
+			break;
+		}
+
+		req = &smp->req[test_data->counter];
+
+		pdu = get_pdu(req->send);
+		bthost_send_cid(bthost, test_data->handle, SMP_CID, pdu,
+								req->send_len);
+		if (req->expect)
+			break;
+		else
+			test_data->counter++;
 	}
 
-	req = &smp->req[test_data->counter];
-
-	pdu = get_pdu(req->send);
-	bthost_send_cid(bthost, test_data->handle, SMP_CID, pdu,
-							req->send_len);
-
-	if (!req->expect)
-		test_condition_complete(test_data);
-
 	return;
 
 failed: