From 889a8a8aee20750a4e9bbf9ffa58c0f427c2d9a5 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 1 Nov 2016 20:58:15 +0100 Subject: [PATCH] tools/mgmt-tester: Fix device found tests Make sure discovery is enabled before enabling advertising. --- tools/mgmt-tester.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index 9d8f73eef..f57b19533 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -6834,7 +6834,7 @@ static void test_remove_device(const void *test_data) test_add_condition(data); } -static void test_device_found(const void *test_data) +static void trigger_device_found(void *user_data) { struct test_data *data = tester_get_data(); const struct generic_data *test = data->test_data; @@ -6854,7 +6854,18 @@ static void test_device_found(const void *test_data) if (data->hciemu_type != HCIEMU_TYPE_LE) bthost_write_scan_enable(bthost, 0x03); + test_condition_complete(data); +} + +static void test_device_found(const void *test_data) +{ + struct test_data *data = tester_get_data(); + test_command_generic(test_data); + + /* Make sure discovery is enabled before enabling advertising. */ + tester_wait(1, trigger_device_found, NULL); + test_add_condition(data); } static void pairing_new_conn(uint16_t handle, void *user_data) -- 2.47.3