Thread (25 messages) flat view 25 messages, 3 authors, 2012-08-14

Re: [PATCH BlueZ] mgmt: Add LE scanning callback

From: Joao Paulo Rechi Vita <hidden>
Date: 2012-08-14 17:59:29

On Tue, Aug 14, 2012 at 7:30 AM, Johan Hedberg [off-list ref] wrote:
Hi,

On Tue, Aug 14, 2012, Johan Hedberg wrote:
quoted
On Fri, Aug 03, 2012, João Paulo Rechi Vita wrote:
quoted
From: Claudio Takahasi <redacted>

This patch adds a new callback to allow the adapter to control LE
scanning. The current approach uses the active scanning with default
windows and intervals defined by the core spec without any filtering.
---
 src/mgmt.c | 32 ++++++++++++++++++++++++++++++++
 src/mgmt.h |  1 +
 2 files changed, 33 insertions(+)
diff --git a/src/mgmt.c b/src/mgmt.c
index 8ae86d3..5ceeaa8 100644
--- a/src/mgmt.c
+++ b/src/mgmt.c
@@ -1999,6 +1999,38 @@ int mgmt_start_discovery(int index)
    return 0;
 }

+int mgmt_start_scanning(int index)
+{
+   char buf[MGMT_HDR_SIZE + sizeof(struct mgmt_cp_start_discovery)];
+   struct mgmt_hdr *hdr = (void *) buf;
+   struct mgmt_cp_start_discovery *cp = (void *) &buf[sizeof(*hdr)];
+   struct controller_info *info = &controllers[index];
+
+   DBG("index %d", index);
+
+   info->discov_type = 0;
+
+   if (mgmt_low_energy(info->current_settings)) {
+           hci_set_bit(BDADDR_LE_PUBLIC, &info->discov_type);
+           hci_set_bit(BDADDR_LE_RANDOM, &info->discov_type);
+   }
Shouldn't you just return an error here (e.g. -ENOTSUP) if LE is not
supported/enabled?

Have there been any patches sent that would use this API? At least I
didn't see any after a quick scan of the mailing list.
I see that these users are part of the original thread sent on Jul 27th.
I got confused since you renamed the subjects in a way that there was no
other indication to the original thread except the References: header.

The point about returning an error still remains though.
Ok, as soon as Claudio fixes this I'll send an updated revision of the
whole series tagged with 'v2'.

-- 
João Paulo Rechi Vita
Openbossa Labs - INdT
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help