All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Tyszkowski <jakub.tyszkowski@tieto.com>
To: linux-bluetooth@vger.kernel.org
Cc: Jakub Tyszkowski <jakub.tyszkowski@tieto.com>
Subject: [PATCHv4 04/13] android/tester: Make PAN tests use io vectors for pdu
Date: Thu,  2 Oct 2014 10:10:52 +0200	[thread overview]
Message-ID: <1412237461-20373-5-git-send-email-jakub.tyszkowski@tieto.com> (raw)
In-Reply-To: <1412237461-20373-1-git-send-email-jakub.tyszkowski@tieto.com>

---
 android/tester-pan.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/android/tester-pan.c b/android/tester-pan.c
index 8d41d34..5aa6c35 100644
--- a/android/tester-pan.c
+++ b/android/tester-pan.c
@@ -29,9 +29,10 @@ struct emu_cid_data {
 };
 
 static struct emu_cid_data cid_data;
-static uint8_t pan_conn_req_pdu[] = { 0x01, 0x01, 0x02, 0x11, 0x16,
-								0x11, 0x15 };
-static uint8_t pan_conn_rsp_pdu[] = { 0x01, 0x02, 0x00, 0x00 };
+
+static const struct iovec pan_conn_req_pdu = raw_pdu(0x01, 0x01, 0x02, 0x11,
+							0x16, 0x11, 0x15);
+static const struct iovec pan_conn_rsp_pdu = raw_pdu(0x01, 0x02, 0x00, 0x00);
 
 static void pan_nap_cid_hook_cb(const void *data, uint16_t len, void *user_data)
 {
@@ -39,10 +40,10 @@ static void pan_nap_cid_hook_cb(const void *data, uint16_t len, void *user_data)
 	struct emu_cid_data *cid_data = user_data;
 	struct bthost *bthost = hciemu_client_get_host(t_data->hciemu);
 
-	if (!memcmp((uint8_t *) data, pan_conn_req_pdu,
-						sizeof(pan_conn_req_pdu)))
-		bthost_send_cid(bthost, cid_data->nap_handle, cid_data->nap_cid,
-				pan_conn_rsp_pdu, sizeof(pan_conn_rsp_pdu));
+	if (!memcmp((uint8_t *) data, pan_conn_req_pdu.iov_base, len))
+		bthost_send_cid_v(bthost, cid_data->nap_handle,
+							cid_data->nap_cid,
+							&pan_conn_rsp_pdu, 1);
 }
 
 static void pan_connect_request_cb(uint16_t handle, uint16_t cid,
-- 
1.9.1


  parent reply	other threads:[~2014-10-02  8:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02  8:10 [PATCHv4 00/13] android/tester: Unifying the way PDU is handled Jakub Tyszkowski
2014-10-02  8:10 ` [PATCHv4 01/13] android/tester: Replace gatt-tester's pdu structs with io vectors Jakub Tyszkowski
2014-10-02  8:10 ` [PATCHv4 02/13] android/tester: Expose structs holding request pdu and response pdu Jakub Tyszkowski
2014-10-02  8:10 ` [PATCHv4 03/13] android/tester: Make HidHost tests use io vectors for pdu Jakub Tyszkowski
2014-10-02  8:10 ` Jakub Tyszkowski [this message]
2014-10-02  8:10 ` [PATCHv4 05/13] android/tester: Make HDP " Jakub Tyszkowski
2014-10-02  8:10 ` [PATCHv4 06/13] android/tester: Add generic hook to handle pdu exchange Jakub Tyszkowski
2014-10-02  8:10 ` [PATCHv4 07/13] android/tester: Make A2DP use generic pdu exchange mechanism Jakub Tyszkowski
2014-10-02  8:10 ` [PATCHv4 08/13] android/tester: Make AVRCP tests " Jakub Tyszkowski
2014-10-02  8:10 ` [PATCHv4 09/13] android/tester: Make GATT use generic cid_data Jakub Tyszkowski
2014-10-02  8:10 ` [PATCHv4 10/13] android/tester: Make HDP tests use generic PDU exchange mechanism Jakub Tyszkowski
2014-10-02  8:10 ` [PATCHv4 11/13] android/tester: Make HIDHost " Jakub Tyszkowski
2014-10-02  8:11 ` [PATCHv4 12/13] android/tester: Make PAN " Jakub Tyszkowski
2014-10-02  8:11 ` [PATCHv4 13/13] android/tester: Use generic connect callback for simple cases Jakub Tyszkowski
2014-10-02 11:22 ` [PATCHv4 00/13] android/tester: Unifying the way PDU is handled Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412237461-20373-5-git-send-email-jakub.tyszkowski@tieto.com \
    --to=jakub.tyszkowski@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.