Diff between 51a8bb208d4cb8d1133f6e97173dffe75823d893 and 06c65aaee7dde41e335dd21d0ab92271e99feec0

Changed Files

File Additions Deletions Status
android/tester-gatt.c +29 -2 modified

Full Patch

diff --git a/android/tester-gatt.c b/android/tester-gatt.c
index 610c1b4..a8dbd35 100644
--- a/android/tester-gatt.c
+++ b/android/tester-gatt.c
@@ -1704,17 +1704,44 @@ static void gatt_remote_send_raw_pdu_action(void)
 	struct bthost *bthost = hciemu_client_get_host(data->hciemu);
 	struct step *current_data_step = queue_peek_head(data->steps);
 	struct iovec *pdu = current_data_step->set_data;
+	struct iovec *pdu2 = current_data_step->set_data_2;
+	struct iovec *pdu3 = current_data_step->set_data_3;
 	struct step *step = g_new0(struct step, 1);
 
 	if (cid_data.handle && cid_data.cid) {
-		bthost_send_cid_v(bthost, cid_data.handle, cid_data.cid,
-									pdu, 1);
+		struct iovec rsp[3];
+		size_t len = 0;
+
+		if (!pdu) {
+			step->action_status = BT_STATUS_FAIL;
+			goto done;
+		}
+
+		rsp[0].iov_base = pdu->iov_base;
+		rsp[0].iov_len = pdu->iov_len;
+		len++;
+
+		if (pdu2) {
+			rsp[1].iov_base = pdu2->iov_base;
+			rsp[1].iov_len = pdu2->iov_len;
+			len++;
+		}
+
+		if (pdu3) {
+			rsp[2].iov_base = pdu3->iov_base;
+			rsp[2].iov_len = pdu3->iov_len;
+			len++;
+		}
+
+		bthost_send_cid_v(bthost, cid_data.handle, cid_data.cid, rsp,
+									len);
 		step->action_status = BT_STATUS_SUCCESS;
 	} else {
 		tester_debug("No connection set up");
 		step->action_status = BT_STATUS_FAIL;
 	}
 
+done:
 	schedule_action_verification(step);
 }