Diff between 7cb7fbcc667bf91e942d924584493447cc9a44f8 and 0056b9b24985a33bd5fd8ce14c40fe0b05df3317

Changed Files

File Additions Deletions Status
android/tester-bluetooth.c +21 -0 modified
android/tester-main.c +11 -0 modified
android/tester-main.h +1 -0 modified

Full Patch

diff --git a/android/tester-bluetooth.c b/android/tester-bluetooth.c
index ea59a57..fd5837d 100644
--- a/android/tester-bluetooth.c
+++ b/android/tester-bluetooth.c
@@ -344,6 +344,27 @@ static struct test_case test_cases[] = {
 							BT_DISCOVERY_STARTED),
 		ACTION_SUCCESS(bt_start_discovery_action, NULL),
 	),
+	TEST_CASE("Bluetooth BR/EDR Discovery Stop - 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),
+		ACTION_SUCCESS(bt_cancel_discovery_action, NULL),
+		CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+							BT_DISCOVERY_STOPPED),
+	),
+	TEST_CASE("Bluetooth BR/EDR Discovery Stop - 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_cancel_discovery_action, NULL),
+		CALLBACK_STATE(CB_BT_DISCOVERY_STATE_CHANGED,
+							BT_DISCOVERY_STOPPED),
+		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 eb588d1..7e2cc09 100644
--- a/android/tester-main.c
+++ b/android/tester-main.c
@@ -953,6 +953,17 @@ void bt_start_discovery_action(void)
 	verify_step(&step, NULL);
 }
 
+void bt_cancel_discovery_action(void)
+{
+	struct test_data *data = tester_get_data();
+	struct step step;
+
+	memset(&step, 0, sizeof(step));
+	step.action_result.status = data->if_bluetooth->cancel_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 9e40907..1e1dd51 100644
--- a/android/tester-main.h
+++ b/android/tester-main.h
@@ -218,3 +218,4 @@ void bluetooth_disable_action(void);
 void bt_set_property_action(void);
 void bt_get_property_action(void);
 void bt_start_discovery_action(void);
+void bt_cancel_discovery_action(void);