diff options
author | Jakub Tyszkowski <jakub.tyszkowski@tieto.com> | 2014-10-02 10:10:52 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-10-02 14:20:48 +0300 |
commit | 573e90f593400491719be9466657393dc22206cd (patch) | |
tree | 23ae73651f6846598b116714cc7547c10963babe /android/tester-pan.c | |
parent | 92b1fb608f1054d5aadb330d8348a381a2966cf5 (diff) | |
download | bluez-573e90f593400491719be9466657393dc22206cd.tar.gz |
android/tester: Make PAN tests use io vectors for pdu
Diffstat (limited to 'android/tester-pan.c')
-rw-r--r-- | android/tester-pan.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/android/tester-pan.c b/android/tester-pan.c index 8d41d3447..5aa6c3573 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, |