&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)
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();
void bluetooth_disable_action(void);
void bt_set_property_action(void);
void bt_get_property_action(void);
+void bt_start_discovery_action(void);