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

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

From: Johan Hedberg <hidden>
Date: 2012-08-14 09:36:05

Hi,

On Fri, Aug 03, 2012, João Paulo Rechi Vita wrote:
quoted hunk ↗ jump to hunk
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.

Johan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help