Diff between 324a38c73d9733163434af5d04936d9a92543bcf and aca151a706873d6b963075f62bb21098fb3d3e85

Changed Files

File Additions Deletions Status
android/tester-main.c +14 -2 modified

Full Patch

diff --git a/android/tester-main.c b/android/tester-main.c
index bbb3375..40416d7 100644
--- a/android/tester-main.c
+++ b/android/tester-main.c
@@ -1029,16 +1029,27 @@ static void emu_connectable_complete(uint16_t opcode, uint8_t status,
 					const void *param, uint8_t len,
 					void *user_data)
 {
-	struct step *step = g_new0(struct step, 1);
+	struct step *step;
+	struct test_data *data = user_data;
 
 	switch (opcode) {
 	case BT_HCI_CMD_WRITE_SCAN_ENABLE:
+		break;
 	case BT_HCI_CMD_LE_SET_ADV_ENABLE:
+		/*
+		 * For BREDRLE emulator we want to verify step after scan
+		 * enable and not after le_set_adv_enable
+		 */
+		if (data->hciemu_type == HCIEMU_TYPE_BREDRLE)
+			return;
+
 		break;
 	default:
 		return;
 	}
 
+	step = g_new0(struct step, 1);
+
 	if (status) {
 		tester_warn("Emulated remote setup failed.");
 		step->action_status = BT_STATUS_FAIL;
@@ -1061,7 +1072,8 @@ void emu_setup_powered_remote_action(void)
 	if ((data->hciemu_type == HCIEMU_TYPE_LE) ||
 				(data->hciemu_type == HCIEMU_TYPE_BREDRLE))
 		bthost_set_adv_enable(bthost, 0x01, 0x02);
-	else
+
+	if (data->hciemu_type != HCIEMU_TYPE_LE)
 		bthost_write_scan_enable(bthost, 0x03);
 }