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

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

 



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

diff --git a/android/android-tester-ng.c b/android/android-tester-ng.c
index 2100ce8..cd7a28c 100644
--- a/android/android-tester-ng.c
+++ b/android/android-tester-ng.c
@@ -1099,6 +1099,14 @@ static bt_property_t setprop_scanmode_conn_disc_prop = {
 	.len = sizeof(bt_scan_mode_t),
 };
 
+static bt_scan_mode_t test_setprop_scanmode_conn = BT_SCAN_MODE_CONNECTABLE;
+
+static bt_property_t setprop_scanmode_conn_prop = {
+	.type = BT_PROPERTY_ADAPTER_SCAN_MODE,
+	.val = &test_setprop_scanmode_conn,
+	.len = sizeof(bt_scan_mode_t),
+};
+
 static void bt_set_scanmode_property(bt_property_t *mode)
 {
 	struct test_data *data = tester_get_data();
@@ -1116,6 +1124,11 @@ static void bt_set_scanmode_conn_discov_action(void)
 	bt_set_scanmode_property(&setprop_scanmode_conn_disc_prop);
 }
 
+static void bt_set_scanmode_conn_action(void)
+{
+	bt_set_scanmode_property(&setprop_scanmode_conn_prop);
+}
+
 static void generic_test_function(const void *test_data)
 {
 	struct test_data *data = tester_get_data();
@@ -1288,6 +1301,25 @@ static struct step bluetooth_setprop_scanmode_conn_disc_success_steps[] = {
 	}
 };
 
+static struct step bluetooth_setprop_scanmode_conn_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_action,
+	},
+	{
+	.callback = CB_BT_ADAPTER_PROPERTIES,
+	.callback_result.properties = &setprop_scanmode_conn_prop,
+	}
+};
+
 static struct step gatt_register_client_success_steps[] = {
 	{
 	.action_result.status = BT_STATUS_SUCCESS,
@@ -1374,6 +1406,10 @@ int main(int argc, char *argv[])
 			bluetooth_setprop_scanmode_conn_disc_success_steps,
 			setup, generic_test_function, teardown);
 
+	test_bredrle("Bluetooth Set SCAN_MODE CONN - Success",
+			bluetooth_setprop_scanmode_conn_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