diff --git a/android/tester-bluetooth.c b/android/tester-bluetooth.c
index d65917d..ea59a57 100644
--- a/android/tester-bluetooth.c
+++ b/android/tester-bluetooth.c
&prop_test_scan_mode_none),
CALLBACK_ADAPTER_PROPS(&prop_test_scan_mode_none, 1),
),
+ TEST_CASE("Bluetooth BR/EDR Discovery Start - Success",
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_start_discovery_action, NULL),
+ CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+ BT_DISCOVERY_STARTED),
+ ),
+ TEST_CASE("Bluetooth BR/EDR Discovery Start - Done",
+ ACTION_SUCCESS(bluetooth_enable_action, NULL),
+ CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
+ ACTION_SUCCESS(bt_start_discovery_action, NULL),
+ CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+ BT_DISCOVERY_STARTED),
+ ACTION_SUCCESS(bt_start_discovery_action, NULL),
+ ),
};
struct queue *get_bluetooth_tests(void)
diff --git a/android/tester-main.c b/android/tester-main.c
index 7f52083..eb588d1 100644
--- a/android/tester-main.c
+++ b/android/tester-main.c
schedule_callback_call(step);
}
+static void discovery_state_changed_cb(bt_discovery_state_t state)
+{
+ struct step *step = g_new0(struct step, 1);
+
+ step->callback = CB_BT_DISCOVERY_STATE_CHANGED;
+ step->callback_result.state = state;
+
+ schedule_callback_call(step);
+}
+
static bt_callbacks_t bt_callbacks = {
.size = sizeof(bt_callbacks),
.adapter_state_changed_cb = adapter_state_changed_cb,
.adapter_properties_cb = adapter_properties_cb,
.remote_device_properties_cb = NULL,
.device_found_cb = NULL,
- .discovery_state_changed_cb = NULL,
+ .discovery_state_changed_cb = discovery_state_changed_cb,
.pin_request_cb = NULL,
.ssp_request_cb = NULL,
.bond_state_changed_cb = NULL,
verify_step(&step, NULL);
}
+void bt_start_discovery_action(void)
+{
+ struct test_data *data = tester_get_data();
+ struct step step;
+
+ step.action_result.status = data->if_bluetooth->start_discovery();
+
+ verify_step(&step, NULL);
+}
+
static void generic_test_function(const void *test_data)
{
struct test_data *data = tester_get_data();
diff --git a/android/tester-main.h b/android/tester-main.h
index 066615a..9e40907 100644
--- a/android/tester-main.h
+++ b/android/tester-main.h
void bluetooth_disable_action(void);
void bt_set_property_action(void);
void bt_get_property_action(void);
+void bt_start_discovery_action(void);