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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, Aug 14, 2012, Johan Hedberg wrote:
> On Fri, Aug 03, 2012, João Paulo Rechi Vita wrote:
> > From: Claudio Takahasi <claudio.takahasi@xxxxxxxxxxxxx>
> > 
> > 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.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux