[PATCH 13/15] android/tester-ng: Add setprop scanmode conn disc success tc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This adds scan mode set property to connectable discoverable success
test case.
---
 android/android-tester-ng.c | 49 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/android/android-tester-ng.c b/android/android-tester-ng.c
index 9351994..2100ce8 100644
--- a/android/android-tester-ng.c
+++ b/android/android-tester-ng.c
@@ -1090,6 +1090,32 @@ static void bt_set_bdname_property_action(void)
 	verify_step(&step, NULL);
 }
 
+static bt_scan_mode_t test_setprop_scanmode_conn_disc =
+					BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE;
+
+static bt_property_t setprop_scanmode_conn_disc_prop = {
+	.type = BT_PROPERTY_ADAPTER_SCAN_MODE,
+	.val = &test_setprop_scanmode_conn_disc,
+	.len = sizeof(bt_scan_mode_t),
+};
+
+static void bt_set_scanmode_property(bt_property_t *mode)
+{
+	struct test_data *data = tester_get_data();
+	struct step step;
+
+	memset(&step, 0, sizeof(step));
+	step.action_result.status =
+				data->if_bluetooth->set_adapter_property(mode);
+
+	verify_step(&step, NULL);
+}
+
+static void bt_set_scanmode_conn_discov_action(void)
+{
+	bt_set_scanmode_property(&setprop_scanmode_conn_disc_prop);
+}
+
 static void generic_test_function(const void *test_data)
 {
 	struct test_data *data = tester_get_data();
@@ -1243,6 +1269,25 @@ static struct step bluetooth_setprop_bdname_success_steps[] = {
 	}
 };
 
+static struct step bluetooth_setprop_scanmode_conn_disc_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,
+	.action = bt_set_scanmode_conn_discov_action,
+	},
+	{
+	.callback = CB_BT_ADAPTER_PROPERTIES,
+	.callback_result.properties = &setprop_scanmode_conn_disc_prop,
+	}
+};
+
 static struct step gatt_register_client_success_steps[] = {
 	{
 	.action_result.status = BT_STATUS_SUCCESS,
@@ -1325,6 +1370,10 @@ int main(int argc, char *argv[])
 					bluetooth_setprop_bdname_success_steps,
 					setup, generic_test_function, teardown);
 
+	test_bredrle("Bluetooth Set SCAN_MODE CONN&DISCOV - Success",
+			bluetooth_setprop_scanmode_conn_disc_success_steps,
+			setup, generic_test_function, teardown);
+
 	test_bredrle("Socket Init", dummy_steps, setup_socket,
 					generic_test_function, teardown);
 
-- 
1.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux