Diff between 66e5db602123dbc185fafddcb6d9a9633388fe07 and 72a76bb64bda0652a7ee4623f3fcf458b6c70a83

Changed Files

File Additions Deletions Status
android/tester-gatt.c +15 -0 modified

Full Patch

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