summaryrefslogtreecommitdiff
path: root/android/tester-gatt.c
diff options
context:
space:
mode:
authorJakub Tyszkowski <jakub.tyszkowski@tieto.com>2015-01-08 10:17:41 +0100
committerSzymon Janc <szymon.janc@tieto.com>2015-01-13 14:46:53 +0100
commit06c65aaee7dde41e335dd21d0ab92271e99feec0 (patch)
tree756800bbd7ed552915eae9d199763895033d581e /android/tester-gatt.c
parent51a8bb208d4cb8d1133f6e97173dffe75823d893 (diff)
downloadbluez-06c65aaee7dde41e335dd21d0ab92271e99feec0.tar.gz
android/tester: Support remote sending pdu from fragments
This handles multiple iovectors instead of one assembled pdu.
Diffstat (limited to 'android/tester-gatt.c')
-rw-r--r--android/tester-gatt.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/android/tester-gatt.c b/android/tester-gatt.c
index 610c1b4bc..a8dbd353c 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);
}