[PATCH 3/4] android/tester: Force remotes ACL disconnection

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

 



From: Marcin Kraglak <marcin.kraglak@xxxxxxxxx>

This is needed or else we would need to extend the timeout for a single
test case in tester framework and wait two more seconds for ACL to disconnect.
---
 android/tester-gatt.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/android/tester-gatt.c b/android/tester-gatt.c
index 0d99320..1d66309 100644
--- a/android/tester-gatt.c
+++ b/android/tester-gatt.c
@@ -286,6 +286,19 @@ static void emu_remote_connect_hci_action(void)
 	schedule_action_verification(step);
 }
 
+static void emu_remote_disconnect_hci_action(void)
+{
+	struct test_data *data = tester_get_data();
+	struct bthost *bthost = hciemu_client_get_host(data->hciemu);
+	struct step *step = g_new0(struct step, 1);
+
+	bthost_hci_disconnect(bthost, cid_data.handle, 0x13);
+
+	step->action_status = BT_STATUS_SUCCESS;
+
+	schedule_action_verification(step);
+}
+
 static struct test_case test_cases[] = {
 	TEST_CASE_BREDRLE("Gatt Init",
 		ACTION_SUCCESS(dummy_action, NULL),
@@ -453,6 +466,8 @@ static struct test_case test_cases[] = {
 		CALLBACK_GATTC_DISCONNECT(GATT_STATUS_SUCCESS,
 						prop_emu_remotes_default_set,
 						CONN1_ID, CLIENT1_ID),
+		/* Close ACL on emulated remotes side so it can reconnect */
+		ACTION_SUCCESS(emu_remote_disconnect_hci_action, NULL),
 		CALLBACK_STATE(CB_BT_ACL_STATE_CHANGED,
 						BT_ACL_STATE_DISCONNECTED),
 		ACTION_SUCCESS(gatt_client_do_listen_action, &client1_conn_req),
-- 
1.9.1

--
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