summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-10-25 23:03:55 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-10-25 23:03:55 +0000
commitd1a192c601d9e0e0f4f0da13fadccb50904c5004 (patch)
treef46f4bd8579c158edea7241b34e7e41ff8acf3f2 /src
parentf35f7aa9aacf6cba18949d927f279475c7ca1571 (diff)
Fix remote name request event handling
Diffstat (limited to 'src')
-rw-r--r--src/hci.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/hci.c b/src/hci.c
index 8351c475..dbfc8ba5 100644
--- a/src/hci.c
+++ b/src/hci.c
@@ -1009,7 +1009,9 @@ int hci_send_req(int dd, struct hci_request *r, int to)
try = 10;
while (try--) {
evt_cmd_complete *cc;
- evt_cmd_status *cs;
+ evt_cmd_status *cs;
+ evt_remote_name_req_complete *rn;
+ remote_name_req_cp *cp;
if (to) {
struct pollfd p;
@@ -1074,6 +1076,20 @@ int hci_send_req(int dd, struct hci_request *r, int to)
memcpy(r->rparam, ptr, r->rlen);
goto done;
+ case EVT_REMOTE_NAME_REQ_COMPLETE:
+ if (hdr->evt != r->event)
+ break;
+
+ rn = r->rparam;
+ cp = r->cparam;
+
+ if (bacmp(&rn->bdaddr, &cp->bdaddr))
+ continue;
+
+ r->rlen = MIN(len, r->rlen);
+ memcpy(r->rparam, ptr, r->rlen);
+ goto done;
+
default:
if (hdr->evt != r->event)
break;