summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/hci.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/hci.c b/src/hci.c
index e04e55a8..6e7fa987 100644
--- a/src/hci.c
+++ b/src/hci.c
@@ -577,11 +577,14 @@ int hci_devba(int dev_id, bdaddr_t *bdaddr)
int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap, inquiry_info **ii, long flags)
{
struct hci_inquiry_req *ir;
+ uint8_t num_rsp = nrsp;
void *buf;
int s, err;
- if (nrsp <= 0)
- nrsp = 200; /* enough ? */
+ if (nrsp <= 0) {
+ num_rsp = 0;
+ nrsp = 255;
+ }
if (dev_id < 0 && (dev_id = hci_get_route(NULL)) < 0) {
errno = ENODEV;
@@ -600,7 +603,7 @@ int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap, inquiry_info
ir = buf;
ir->dev_id = dev_id;
- ir->num_rsp = nrsp;
+ ir->num_rsp = num_rsp;
ir->length = len;
ir->flags = flags;