summaryrefslogtreecommitdiff
path: root/tools/smp-tester.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-05-27 11:32:18 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2014-12-03 16:32:47 +0200
commitd6d3d26bdadb6202b5993a2685137a9f21ba55de (patch)
tree9a082f7a5baf04f307be6f92f653f322e20bd7f6 /tools/smp-tester.c
parent347bb9cad49e0cd9aa94c67c5f6027cbb9c0ee6c (diff)
downloadbluez-d6d3d26bdadb6202b5993a2685137a9f21ba55de.tar.gz
smp-tester: Allow multiple sending without expecting data
Sometimes we need to send multiple PDUs without waiting for any specific PDU in between.
Diffstat (limited to 'tools/smp-tester.c')
-rw-r--r--tools/smp-tester.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/tools/smp-tester.c b/tools/smp-tester.c
index b1d25a36f..45c4d8bed 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: