Diff between 8cbfee5f962e90b1930b93eea650d8eb9e151819 and 80a5bb2a4ac28ce6ab15f49bde281b1d687d2630

Changed Files

File Additions Deletions Status
android/tester-gatt.c +7 -3 modified
android/tester-main.c +7 -1 modified
android/tester-main.h +3 -0 modified

Full Patch

diff --git a/android/tester-gatt.c b/android/tester-gatt.c
index 979a1de..b680322 100644
--- a/android/tester-gatt.c
+++ b/android/tester-gatt.c
@@ -95,6 +95,10 @@ static struct gatt_connect_data client2_conn_req = {
 static const uint8_t exchange_mtu_req_pdu[] = { 0x02, 0xa0, 0x02 };
 static const uint8_t exchange_mtu_resp_pdu[] = { 0x03, 0xa0, 0x02 };
 
+static struct bt_action_data bearer_type = {
+	.bearer_type = BDADDR_LE_PUBLIC,
+};
+
 static void gatt_client_register_action(void)
 {
 	struct test_data *data = tester_get_data();
@@ -380,7 +384,7 @@ static struct test_case test_cases[] = {
 		CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
 		ACTION_SUCCESS(gatt_client_do_listen_action, &client1_conn_req),
 		CALLBACK_STATUS(CB_GATTC_LISTEN, GATT_STATUS_SUCCESS),
-		ACTION_SUCCESS(emu_remote_connect_hci_action, NULL),
+		ACTION_SUCCESS(emu_remote_connect_hci_action, &bearer_type),
 		CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
 						prop_emu_remotes_default_set,
 						CONN1_ID, CLIENT1_ID),
@@ -408,7 +412,7 @@ static struct test_case test_cases[] = {
 		CALLBACK_STATUS(CB_GATTC_REGISTER_CLIENT, BT_STATUS_SUCCESS),
 		ACTION_SUCCESS(gatt_client_do_listen_action, &client1_conn_req),
 		CALLBACK_STATUS(CB_GATTC_LISTEN, GATT_STATUS_SUCCESS),
-		ACTION_SUCCESS(emu_remote_connect_hci_action, NULL),
+		ACTION_SUCCESS(emu_remote_connect_hci_action, &bearer_type),
 		CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
 						prop_emu_remotes_default_set,
 						CONN1_ID, CLIENT1_ID),
@@ -427,7 +431,7 @@ static struct test_case test_cases[] = {
 						BT_ACL_STATE_DISCONNECTED),
 		ACTION_SUCCESS(gatt_client_do_listen_action, &client1_conn_req),
 		CALLBACK_STATUS(CB_GATTC_LISTEN, GATT_STATUS_SUCCESS),
-		ACTION_SUCCESS(emu_remote_connect_hci_action, NULL),
+		ACTION_SUCCESS(emu_remote_connect_hci_action, &bearer_type),
 		CALLBACK_GATTC_CONNECT(GATT_STATUS_SUCCESS,
 						prop_emu_remotes_default_set,
 						CONN2_ID, CLIENT1_ID),
diff --git a/android/tester-main.c b/android/tester-main.c
index c41ce1c..310efb0 100644
--- a/android/tester-main.c
+++ b/android/tester-main.c
@@ -1627,6 +1627,8 @@ void emu_remote_connect_hci_action(void)
 {
 	struct test_data *data = tester_get_data();
 	struct bthost *bthost = hciemu_client_get_host(data->hciemu);
+	struct step *current_data_step = queue_peek_head(data->steps);
+	struct bt_action_data *action_data = current_data_step->set_data;
 	struct step *step = g_new0(struct step, 1);
 	const uint8_t *master_addr;
 
@@ -1634,7 +1636,11 @@ void emu_remote_connect_hci_action(void)
 
 	tester_print("Trying to connect hci");
 
-	bthost_hci_connect(bthost, master_addr, BDADDR_LE_PUBLIC);
+	if (action_data)
+		bthost_hci_connect(bthost, master_addr,
+						action_data->bearer_type);
+	else
+		bthost_hci_connect(bthost, master_addr, BDADDR_BREDR);
 
 	step->action_status = BT_STATUS_SUCCESS;
 
diff --git a/android/tester-main.h b/android/tester-main.h
index 3331e91..e83933a 100644
--- a/android/tester-main.h
+++ b/android/tester-main.h
@@ -343,6 +343,9 @@ struct bt_action_data {
 
 	/* HidHost params */
 	const int report_size;
+
+	/*Connection params*/
+	const uint8_t bearer_type;
 };
 
 /* bthost's l2cap server setup parameters */