Diff between 7bc8fe2874052c9d218da5cec41bcc214a02b9db and 0a9c7b4b6262edb39656375efb0da038252132c1

Changed Files

File Additions Deletions Status
android/tester-bluetooth.c +37 -0 modified

Full Patch

diff --git a/android/tester-bluetooth.c b/android/tester-bluetooth.c
index bff6ea9..56518ea 100644
--- a/android/tester-bluetooth.c
+++ b/android/tester-bluetooth.c
@@ -201,6 +201,40 @@ static struct test_case bluetooth_setprop_scanmode_success_tc = {
 				bluetooth_setprop_scanmode_success_steps),
 };
 
+static uint32_t test_setprop_disctimeout_val = 600;
+
+static bt_property_t setprop_disctimeout_prop = {
+	.type = BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT,
+	.val = &test_setprop_disctimeout_val,
+	.len = sizeof(test_setprop_disctimeout_val),
+};
+
+static struct step bluetooth_setprop_disctimeout_success_steps[] = {
+	{
+		.action_result.status = BT_STATUS_SUCCESS,
+		.action = bluetooth_enable_action,
+	},
+	{
+		.callback = CB_BT_ADAPTER_STATE_CHANGED,
+		.callback_result.state = BT_STATE_ON,
+	},
+	{
+		.action_result.status = BT_STATUS_SUCCESS,
+		.set_data = &setprop_disctimeout_prop,
+		.action = bt_set_property_action,
+	},
+	{
+		.callback = CB_BT_ADAPTER_PROPERTIES,
+		.callback_result.properties = NULL,
+	},
+};
+static struct test_case bluetooth_setprop_disctimeout_success_tc = {
+	.step = bluetooth_setprop_disctimeout_success_steps,
+	.title = "Bluetooth Set DISCOVERY_TIMEOUT - Success",
+	.step_num = get_test_case_step_num(
+				bluetooth_setprop_disctimeout_success_steps),
+};
+
 struct queue *get_bluetooth_tests(void)
 {
 	list = queue_new();
@@ -223,6 +257,9 @@ struct queue *get_bluetooth_tests(void)
 	if (!queue_push_tail(list, &bluetooth_setprop_scanmode_success_tc))
 		return NULL;
 
+	if (!queue_push_tail(list, &bluetooth_setprop_disctimeout_success_tc))
+		return NULL;
+
 	return list;
 }