Linux-Bluetooth Archive on lore.kernel.org
 help / Atom feed
* [Bluez-users] Multiple Bluetooth connections
@ 2005-03-15 18:48 Pedro Monjo Florit
  2005-03-15 19:27 ` sir
  2005-03-16  9:42 ` Marcel Holtmann
  0 siblings, 2 replies; 10+ messages in thread
From: Pedro Monjo Florit @ 2005-03-15 18:48 UTC (permalink / raw)
  To: bluez-users

Hi,

In the application that I am developing, I want to send simultaneous 
OBEX messages to different OBEX servers over Bluetooth. I am using 
OpenOBEX for this purpose. There are two problems I am facing.

On the one hand, it seems that there is only room to establish one 
Bluetooth connection at a time. If I start many OBEX pushes 
simultaneously, only the first one succeeds. The others fail usually 
with error "Device or resource busy" (errno=16); sometimes even with 
"Software caused connection abort" (errno=103). Once the first 
connection is established and while sending OBEX data, I can establish 
another connection.

I just want to make clear that the problem is with the establishment of 
the connection. I am fully aware that it is possible to handle various 
on-going connections with no problems and I have succeeded with that. Is 
there a limitation with Bluetooth or BlueZ that allows only one RFCOMM, 
L2CAP or HCI connection establishment?

On the other hand, some connections die before sending the data, but it 
seems that the file descriptor of this connection does not receive any 
notification (I use select() on all file descriptors, with the file 
descriptor in the read mask). I know that this could be due to a problem 
with my program, a problem with OpenOBEX or the BlueZ version I am using 
(it is not the latest). In any case, to track down the cause, I would 
like to know how can I monitor the Bluetooth connections (at any level, 
but preferably RFCOMM) that a process (or the whole system) has. What I 
am looking for is a tool like netstat.

Thanks & regards,

Pedro Monjo


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Bluez-users] Multiple Bluetooth connections
  2005-03-15 18:48 [Bluez-users] Multiple Bluetooth connections Pedro Monjo Florit
@ 2005-03-15 19:27 ` sir
  2005-03-16  9:42 ` Marcel Holtmann
  1 sibling, 0 replies; 10+ messages in thread
From: sir @ 2005-03-15 19:27 UTC (permalink / raw)
  To: bluez-users

It is quite as my problem, I can't find any documentation about 
bluetooth java and multiple connections,
I create to threads that open a RFCOMM connection on my computer, and 
try to connect a mobile phone or a pda,
but only one thread receive the connection and the seconde mobile unit 
can't establish the link with the server.


It is not enough documentated.

If somebody can help us....



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Bluez-users] Multiple Bluetooth connections
  2005-03-15 18:48 [Bluez-users] Multiple Bluetooth connections Pedro Monjo Florit
  2005-03-15 19:27 ` sir
@ 2005-03-16  9:42 ` Marcel Holtmann
  2005-03-16 11:23   ` Pedro Monjo Florit
       [not found]   ` <marcel@holtmann.org>
  1 sibling, 2 replies; 10+ messages in thread
From: Marcel Holtmann @ 2005-03-16  9:42 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Pedro,

> In the application that I am developing, I want to send simultaneous 
> OBEX messages to different OBEX servers over Bluetooth. I am using 
> OpenOBEX for this purpose. There are two problems I am facing.
> 
> On the one hand, it seems that there is only room to establish one 
> Bluetooth connection at a time. If I start many OBEX pushes 
> simultaneously, only the first one succeeds. The others fail usually 
> with error "Device or resource busy" (errno=16); sometimes even with 
> "Software caused connection abort" (errno=103). Once the first 
> connection is established and while sending OBEX data, I can establish 
> another connection.
> 
> I just want to make clear that the problem is with the establishment of 
> the connection. I am fully aware that it is possible to handle various 
> on-going connections with no problems and I have succeeded with that. Is 
> there a limitation with Bluetooth or BlueZ that allows only one RFCOMM, 
> L2CAP or HCI connection establishment?

this is a hardware limit and I don't know of any chip that is capable of
establishing two connections at the same time. From what I know this
will never be possible, but you should better ask a radio/baseband
expert for a correct answer.

> On the other hand, some connections die before sending the data, but it 
> seems that the file descriptor of this connection does not receive any 
> notification (I use select() on all file descriptors, with the file 
> descriptor in the read mask). I know that this could be due to a problem 
> with my program, a problem with OpenOBEX or the BlueZ version I am using 
> (it is not the latest). In any case, to track down the cause, I would 
> like to know how can I monitor the Bluetooth connections (at any level, 
> but preferably RFCOMM) that a process (or the whole system) has. What I 
> am looking for is a tool like netstat.

Using poll() or select() is the right way. About what version of the
kernel and library/utils are we talking?

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Bluez-users] Multiple Bluetooth connections 
       [not found]   ` <marcel@holtmann.org>
@ 2005-03-16 10:40     ` Peter Stephenson
  2018-10-30 10:24     ` [PATCH v2] Bluetooth: Support fast advertising interval Bharat Bhusan Panda
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Stephenson @ 2005-03-16 10:40 UTC (permalink / raw)
  To: bluez-users

Marcel Holtmann wrote:
> this is a hardware limit and I don't know of any chip that is capable of
> establishing two connections at the same time. From what I know this
> will never be possible, but you should better ask a radio/baseband
> expert for a correct answer.

Below HCI, it won't work in a typical set up.  The usual scan mode is "R1
page scan repetition mode" where the device scans at least (and usually
only) every 1.28 seconds, usually for 18 slots.  If you try to page
two devices at once, you run the risk of switching to paging the other
device at exactly the short window you need to pick up one device,
and hence miss it altogether.  You can do it when the devices are in
"R0" (continuous scan) but then connection time should be more or
less instantaneous anyway and there's no gain.  So it's not supported
by HCI_Create_Connection.

Once you have an ACL connection, it should be entirely possible to
negotiate multiple channels over the top of it, depending on the
software.

pws


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Bluez-users] Multiple Bluetooth connections
  2005-03-16  9:42 ` Marcel Holtmann
@ 2005-03-16 11:23   ` Pedro Monjo Florit
  2005-03-16 11:44     ` Marcel Holtmann
       [not found]   ` <marcel@holtmann.org>
  1 sibling, 1 reply; 10+ messages in thread
From: Pedro Monjo Florit @ 2005-03-16 11:23 UTC (permalink / raw)
  To: bluez-users

[-- Attachment #1: Type: text/plain, Size: 2016 bytes --]

Hi Marcel,
>this is a hardware limit and I don't know of any chip that is capable of
>establishing two connections at the same time. From what I know this
>will never be possible, but you should better ask a radio/baseband
>expert for a correct answer.
>  
Thank you for the information. Together with the post of Peter 
Stephenson (thank you, Peter), it seems that this problem cannot be 
circumvented as I want to connect to different devices (as I understand, 
various ACL connections; is this right?). I will have to live with it. :-(
>>On the other hand, some connections die before sending the data, but it 
>>seems that the file descriptor of this connection does not receive any 
>>notification (I use select() on all file descriptors, with the file 
>>descriptor in the read mask). I know that this could be due to a problem 
>>with my program, a problem with OpenOBEX or the BlueZ version I am using 
>>(it is not the latest). In any case, to track down the cause, I would 
>>like to know how can I monitor the Bluetooth connections (at any level, 
>>but preferably RFCOMM) that a process (or the whole system) has. What I 
>>am looking for is a tool like netstat.
>>    
>
>Using poll() or select() is the right way. About what version of the
>kernel and library/utils are we talking?
>  
I am using SuSE 9.1 with the latest updates from SuSE: kernel 
2.6.5-7.147-default, bluez-libs 2.5-43 and bluez-utils 2.4-65. I know 
they are old, so it could perfectly be a problem with them; therefore I 
am planning an upgrade, but I am not quite sure whether I will be able 
to use the latest BlueZ upgrades. The problem with the lost established 
connections does not happen always, so I still have to look exactly why 
this happens. In any case, besides that, everything else works as 
expected. The only thing I am missing is a tool like "netstat" for 
Internet an Unix sockets. "lsof" does not give any information either. 
Is there anything of the like for BlueZ?

In any, case, thanks for the help.

Pedro

[-- Attachment #2: Type: text/html, Size: 2545 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Bluez-users] Multiple Bluetooth connections
  2005-03-16 11:23   ` Pedro Monjo Florit
@ 2005-03-16 11:44     ` Marcel Holtmann
  0 siblings, 0 replies; 10+ messages in thread
From: Marcel Holtmann @ 2005-03-16 11:44 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Pedro,

> > this is a hardware limit and I don't know of any chip that is capable of
> > establishing two connections at the same time. From what I know this
> > will never be possible, but you should better ask a radio/baseband
> > expert for a correct answer.
> >   
> Thank you for the information. Together with the post of Peter
> Stephenson (thank you, Peter), it seems that this problem cannot be
> circumvented as I want to connect to different devices (as I
> understand, various ACL connections; is this right?). I will have to
> live with it. :-(

you can have multiple ACL connections. If this is a CSR chip you need at
least the HCI 16.4 firmware on it. However you can't create them at the
same time. If one is established you can create another one. Up to seven
if you keep the roles (master/slave) correct.

> > > On the other hand, some connections die before sending the data, but it 
> > > seems that the file descriptor of this connection does not receive any 
> > > notification (I use select() on all file descriptors, with the file 
> > > descriptor in the read mask). I know that this could be due to a problem 
> > > with my program, a problem with OpenOBEX or the BlueZ version I am using 
> > > (it is not the latest). In any case, to track down the cause, I would 
> > > like to know how can I monitor the Bluetooth connections (at any level, 
> > > but preferably RFCOMM) that a process (or the whole system) has. What I 
> > > am looking for is a tool like netstat.
> > >     
> > 
> > Using poll() or select() is the right way. About what version of the
> > kernel and library/utils are we talking?
> >   
> I am using SuSE 9.1 with the latest updates from SuSE: kernel
> 2.6.5-7.147-default, bluez-libs 2.5-43 and bluez-utils 2.4-65. I know
> they are old, so it could perfectly be a problem with them; therefore
> I am planning an upgrade, but I am not quite sure whether I will be
> able to use the latest BlueZ upgrades. The problem with the lost
> established connections does not happen always, so I still have to
> look exactly why this happens. In any case, besides that, everything
> else works as expected. The only thing I am missing is a tool like
> "netstat" for Internet an Unix sockets. "lsof" does not give any
> information either. Is there anything of the like for BlueZ?

We don't have any tool like this. May you wanna check /proc/bluetooth/
and make use of hcidump.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2] Bluetooth: Support fast advertising interval
       [not found]   ` <marcel@holtmann.org>
  2005-03-16 10:40     ` Peter Stephenson
@ 2018-10-30 10:24     ` Bharat Bhusan Panda
  2018-11-13  9:00       ` Panda, Bharat B
  1 sibling, 1 reply; 10+ messages in thread
From: Bharat Bhusan Panda @ 2018-10-30 10:24 UTC (permalink / raw)
  To: linux-bluetooth

Changes made to add support for fast advertising interval as per
core 4.1 specification, section 9.3.11.2.

A peripheral device entering any of the following GAP modes and
sending either non-connectable advertising events or scannable undirected
advertising events should use adv_fast_interval2(100ms - 150ms)
for adv_fast_period(30s).
         - Non-Discoverable Mode
         - Non-Connectable Mode
         - Limited Discoverable Mode
         - General Discoverable Mode

Signed-off-by: Bharat Bhusan Panda <bharat.b.panda@intel.com>
---
 include/net/bluetooth/hci_core.h |  2 ++
 net/bluetooth/hci_request.c      | 27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 0db1b9b..868c2fb 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1491,6 +1491,8 @@ struct hci_mgmt_chan {
 #define DISCOV_INTERLEAVED_INQUIRY_LEN	0x04
 #define DISCOV_BREDR_INQUIRY_LEN	0x08
 #define DISCOV_LE_RESTART_DELAY		msecs_to_jiffies(200)	/* msec */
+#define DISCOV_LE_FAST_ADV_INT_MIN	100	/* msec */
+#define DISCOV_LE_FAST_ADV_INT_MAX	150	/* msec */
 
 void mgmt_fill_version_info(void *ver);
 int mgmt_new_settings(struct hci_dev *hdev);
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index e8c9ef1..fe43498 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -1092,6 +1092,33 @@ void __hci_req_enable_advertising(struct hci_request *req)
 	else
 		cp.type = LE_ADV_NONCONN_IND;
 
+	/* As per core 4.1 spec, section 9.3.11.2: A peripheral device
+	 * entering any of the following GAP modes and sending either
+	 * non-connectable advertising events or scannable undirected
+	 * advertising events should use adv_fast_interval2(100ms - 150ms)
+	 * for adv_fast_period(30s).
+	 *
+	 * 	- Non-Discoverable Mode
+	 *	- Non-Connectable Mode
+	 * 	- Limited Discoverable Mode
+	 * 	- General Discoverable Mode
+	 */
+	if (cp.type == LE_ADV_NONCONN_IND || cp.type == LE_ADV_SCAN_IND) {
+		/* Set the suggested min and max fast advertising interval,
+		 * only if the peripheral device has entered any of the modes
+		 * such as non-discoverable, non-connectable or limited-
+		 * discoverable.
+		 */
+		if (!hci_dev_test_flag(hdev, HCI_DISCOVERABLE) ||
+			!hci_dev_test_flag(hdev, HCI_CONNECTABLE) ||
+			hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) {
+			cp.min_interval =
+				cpu_to_le16(DISCOV_LE_FAST_ADV_INT_MIN);
+			cp.max_interval =
+				cpu_to_le16(DISCOV_LE_FAST_ADV_INT_MAX);
+		}
+	}
+
 	cp.own_address_type = own_addr_type;
 	cp.channel_map = hdev->le_adv_channel_map;
 
-- 
1.9.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH v2] Bluetooth: Support fast advertising interval
  2018-10-30 10:24     ` [PATCH v2] Bluetooth: Support fast advertising interval Bharat Bhusan Panda
@ 2018-11-13  9:00       ` Panda, Bharat B
  2018-11-23 10:52         ` Panda, Bharat B
  0 siblings, 1 reply; 10+ messages in thread
From: Panda, Bharat B @ 2018-11-13  9:00 UTC (permalink / raw)
  To: linux-bluetooth, Marcel Holtmann; +Cc: Panda, Bharat B

Soft reminder.

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Bharat Bhusan Panda
> Sent: Tuesday, October 30, 2018 3:55 PM
> To: linux-bluetooth@vger.kernel.org
> Subject: [PATCH v2] Bluetooth: Support fast advertising interval
> 
> Changes made to add support for fast advertising interval as per core 4.1
> specification, section 9.3.11.2.
> 
> A peripheral device entering any of the following GAP modes and sending either
> non-connectable advertising events or scannable undirected advertising events
> should use adv_fast_interval2(100ms - 150ms) for adv_fast_period(30s).
>          - Non-Discoverable Mode
>          - Non-Connectable Mode
>          - Limited Discoverable Mode
>          - General Discoverable Mode
> 
> Signed-off-by: Bharat Bhusan Panda <bharat.b.panda@intel.com>
> ---
>  include/net/bluetooth/hci_core.h |  2 ++
>  net/bluetooth/hci_request.c      | 27 +++++++++++++++++++++++++++
>  2 files changed, 29 insertions(+)
> 
> diff --git a/include/net/bluetooth/hci_core.h
> b/include/net/bluetooth/hci_core.h
> index 0db1b9b..868c2fb 100644
> --- a/include/net/bluetooth/hci_core.h
> +++ b/include/net/bluetooth/hci_core.h
> @@ -1491,6 +1491,8 @@ struct hci_mgmt_chan {
>  #define DISCOV_INTERLEAVED_INQUIRY_LEN	0x04
>  #define DISCOV_BREDR_INQUIRY_LEN	0x08
>  #define DISCOV_LE_RESTART_DELAY		msecs_to_jiffies(200)	/*
> msec */
> +#define DISCOV_LE_FAST_ADV_INT_MIN	100	/* msec */
> +#define DISCOV_LE_FAST_ADV_INT_MAX	150	/* msec */
> 
>  void mgmt_fill_version_info(void *ver);  int mgmt_new_settings(struct hci_dev
> *hdev); diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
> index e8c9ef1..fe43498 100644
> --- a/net/bluetooth/hci_request.c
> +++ b/net/bluetooth/hci_request.c
> @@ -1092,6 +1092,33 @@ void __hci_req_enable_advertising(struct
> hci_request *req)
>  	else
>  		cp.type = LE_ADV_NONCONN_IND;
> 
> +	/* As per core 4.1 spec, section 9.3.11.2: A peripheral device
> +	 * entering any of the following GAP modes and sending either
> +	 * non-connectable advertising events or scannable undirected
> +	 * advertising events should use adv_fast_interval2(100ms - 150ms)
> +	 * for adv_fast_period(30s).
> +	 *
> +	 * 	- Non-Discoverable Mode
> +	 *	- Non-Connectable Mode
> +	 * 	- Limited Discoverable Mode
> +	 * 	- General Discoverable Mode
> +	 */
> +	if (cp.type == LE_ADV_NONCONN_IND || cp.type ==
> LE_ADV_SCAN_IND) {
> +		/* Set the suggested min and max fast advertising interval,
> +		 * only if the peripheral device has entered any of the modes
> +		 * such as non-discoverable, non-connectable or limited-
> +		 * discoverable.
> +		 */
> +		if (!hci_dev_test_flag(hdev, HCI_DISCOVERABLE) ||
> +			!hci_dev_test_flag(hdev, HCI_CONNECTABLE) ||
> +			hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE))
> {
> +			cp.min_interval =
> +				cpu_to_le16(DISCOV_LE_FAST_ADV_INT_MIN);
> +			cp.max_interval =
> +
> 	cpu_to_le16(DISCOV_LE_FAST_ADV_INT_MAX);
> +		}
> +	}
> +
>  	cp.own_address_type = own_addr_type;
>  	cp.channel_map = hdev->le_adv_channel_map;
> 
> --
> 1.9.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH v2] Bluetooth: Support fast advertising interval
  2018-11-13  9:00       ` Panda, Bharat B
@ 2018-11-23 10:52         ` Panda, Bharat B
  2018-12-07 12:34           ` Panda, Bharat B
  0 siblings, 1 reply; 10+ messages in thread
From: Panda, Bharat B @ 2018-11-23 10:52 UTC (permalink / raw)
  To: linux-bluetooth, Marcel Holtmann

Ping

> -----Original Message-----
> From: Panda, Bharat B
> Sent: Tuesday, November 13, 2018 2:31 PM
> To: linux-bluetooth@vger.kernel.org; 'Marcel Holtmann'
> <marcel@holtmann.org>
> Cc: Panda, Bharat B <bharat.b.panda@intel.com>
> Subject: RE: [PATCH v2] Bluetooth: Support fast advertising interval
> 
> Soft reminder.
> 
> > -----Original Message-----
> > From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> > owner@vger.kernel.org] On Behalf Of Bharat Bhusan Panda
> > Sent: Tuesday, October 30, 2018 3:55 PM
> > To: linux-bluetooth@vger.kernel.org
> > Subject: [PATCH v2] Bluetooth: Support fast advertising interval
> >
> > Changes made to add support for fast advertising interval as per core
> > 4.1 specification, section 9.3.11.2.
> >
> > A peripheral device entering any of the following GAP modes and
> > sending either non-connectable advertising events or scannable
> > undirected advertising events should use adv_fast_interval2(100ms - 150ms)
> for adv_fast_period(30s).
> >          - Non-Discoverable Mode
> >          - Non-Connectable Mode
> >          - Limited Discoverable Mode
> >          - General Discoverable Mode
> >
> > Signed-off-by: Bharat Bhusan Panda <bharat.b.panda@intel.com>
> > ---
> >  include/net/bluetooth/hci_core.h |  2 ++
> >  net/bluetooth/hci_request.c      | 27 +++++++++++++++++++++++++++
> >  2 files changed, 29 insertions(+)
> >
> > diff --git a/include/net/bluetooth/hci_core.h
> > b/include/net/bluetooth/hci_core.h
> > index 0db1b9b..868c2fb 100644
> > --- a/include/net/bluetooth/hci_core.h
> > +++ b/include/net/bluetooth/hci_core.h
> > @@ -1491,6 +1491,8 @@ struct hci_mgmt_chan {
> >  #define DISCOV_INTERLEAVED_INQUIRY_LEN	0x04
> >  #define DISCOV_BREDR_INQUIRY_LEN	0x08
> >  #define DISCOV_LE_RESTART_DELAY		msecs_to_jiffies(200)	/*
> > msec */
> > +#define DISCOV_LE_FAST_ADV_INT_MIN	100	/* msec */
> > +#define DISCOV_LE_FAST_ADV_INT_MAX	150	/* msec */
> >
> >  void mgmt_fill_version_info(void *ver);  int mgmt_new_settings(struct
> > hci_dev *hdev); diff --git a/net/bluetooth/hci_request.c
> > b/net/bluetooth/hci_request.c index e8c9ef1..fe43498 100644
> > --- a/net/bluetooth/hci_request.c
> > +++ b/net/bluetooth/hci_request.c
> > @@ -1092,6 +1092,33 @@ void __hci_req_enable_advertising(struct
> > hci_request *req)
> >  	else
> >  		cp.type = LE_ADV_NONCONN_IND;
> >
> > +	/* As per core 4.1 spec, section 9.3.11.2: A peripheral device
> > +	 * entering any of the following GAP modes and sending either
> > +	 * non-connectable advertising events or scannable undirected
> > +	 * advertising events should use adv_fast_interval2(100ms - 150ms)
> > +	 * for adv_fast_period(30s).
> > +	 *
> > +	 * 	- Non-Discoverable Mode
> > +	 *	- Non-Connectable Mode
> > +	 * 	- Limited Discoverable Mode
> > +	 * 	- General Discoverable Mode
> > +	 */
> > +	if (cp.type == LE_ADV_NONCONN_IND || cp.type ==
> > LE_ADV_SCAN_IND) {
> > +		/* Set the suggested min and max fast advertising interval,
> > +		 * only if the peripheral device has entered any of the modes
> > +		 * such as non-discoverable, non-connectable or limited-
> > +		 * discoverable.
> > +		 */
> > +		if (!hci_dev_test_flag(hdev, HCI_DISCOVERABLE) ||
> > +			!hci_dev_test_flag(hdev, HCI_CONNECTABLE) ||
> > +			hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE))
> > {
> > +			cp.min_interval =
> > +				cpu_to_le16(DISCOV_LE_FAST_ADV_INT_MIN);
> > +			cp.max_interval =
> > +
> > 	cpu_to_le16(DISCOV_LE_FAST_ADV_INT_MAX);
> > +		}
> > +	}
> > +
> >  	cp.own_address_type = own_addr_type;
> >  	cp.channel_map = hdev->le_adv_channel_map;
> >
> > --
> > 1.9.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH v2] Bluetooth: Support fast advertising interval
  2018-11-23 10:52         ` Panda, Bharat B
@ 2018-12-07 12:34           ` Panda, Bharat B
  0 siblings, 0 replies; 10+ messages in thread
From: Panda, Bharat B @ 2018-12-07 12:34 UTC (permalink / raw)
  To: Panda, Bharat B, linux-bluetooth, Marcel Holtmann

Any update on this.

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Panda, Bharat B
> Sent: Friday, November 23, 2018 4:22 PM
> To: linux-bluetooth@vger.kernel.org; 'Marcel Holtmann'
> <marcel@holtmann.org>
> Subject: RE: [PATCH v2] Bluetooth: Support fast advertising interval
> 
> Ping
> 
> > -----Original Message-----
> > From: Panda, Bharat B
> > Sent: Tuesday, November 13, 2018 2:31 PM
> > To: linux-bluetooth@vger.kernel.org; 'Marcel Holtmann'
> > <marcel@holtmann.org>
> > Cc: Panda, Bharat B <bharat.b.panda@intel.com>
> > Subject: RE: [PATCH v2] Bluetooth: Support fast advertising interval
> >
> > Soft reminder.
> >
> > > -----Original Message-----
> > > From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> > > owner@vger.kernel.org] On Behalf Of Bharat Bhusan Panda
> > > Sent: Tuesday, October 30, 2018 3:55 PM
> > > To: linux-bluetooth@vger.kernel.org
> > > Subject: [PATCH v2] Bluetooth: Support fast advertising interval
> > >
> > > Changes made to add support for fast advertising interval as per
> > > core
> > > 4.1 specification, section 9.3.11.2.
> > >
> > > A peripheral device entering any of the following GAP modes and
> > > sending either non-connectable advertising events or scannable
> > > undirected advertising events should use adv_fast_interval2(100ms -
> > > 150ms)
> > for adv_fast_period(30s).
> > >          - Non-Discoverable Mode
> > >          - Non-Connectable Mode
> > >          - Limited Discoverable Mode
> > >          - General Discoverable Mode
> > >
> > > Signed-off-by: Bharat Bhusan Panda <bharat.b.panda@intel.com>
> > > ---
> > >  include/net/bluetooth/hci_core.h |  2 ++
> > >  net/bluetooth/hci_request.c      | 27 +++++++++++++++++++++++++++
> > >  2 files changed, 29 insertions(+)
> > >
> > > diff --git a/include/net/bluetooth/hci_core.h
> > > b/include/net/bluetooth/hci_core.h
> > > index 0db1b9b..868c2fb 100644
> > > --- a/include/net/bluetooth/hci_core.h
> > > +++ b/include/net/bluetooth/hci_core.h
> > > @@ -1491,6 +1491,8 @@ struct hci_mgmt_chan {
> > >  #define DISCOV_INTERLEAVED_INQUIRY_LEN	0x04
> > >  #define DISCOV_BREDR_INQUIRY_LEN	0x08
> > >  #define DISCOV_LE_RESTART_DELAY		msecs_to_jiffies(200)
> 	/*
> > > msec */
> > > +#define DISCOV_LE_FAST_ADV_INT_MIN	100	/* msec */
> > > +#define DISCOV_LE_FAST_ADV_INT_MAX	150	/* msec */
> > >
> > >  void mgmt_fill_version_info(void *ver);  int
> > > mgmt_new_settings(struct hci_dev *hdev); diff --git
> > > a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index
> > > e8c9ef1..fe43498 100644
> > > --- a/net/bluetooth/hci_request.c
> > > +++ b/net/bluetooth/hci_request.c
> > > @@ -1092,6 +1092,33 @@ void __hci_req_enable_advertising(struct
> > > hci_request *req)
> > >  	else
> > >  		cp.type = LE_ADV_NONCONN_IND;
> > >
> > > +	/* As per core 4.1 spec, section 9.3.11.2: A peripheral device
> > > +	 * entering any of the following GAP modes and sending either
> > > +	 * non-connectable advertising events or scannable undirected
> > > +	 * advertising events should use adv_fast_interval2(100ms - 150ms)
> > > +	 * for adv_fast_period(30s).
> > > +	 *
> > > +	 * 	- Non-Discoverable Mode
> > > +	 *	- Non-Connectable Mode
> > > +	 * 	- Limited Discoverable Mode
> > > +	 * 	- General Discoverable Mode
> > > +	 */
> > > +	if (cp.type == LE_ADV_NONCONN_IND || cp.type ==
> > > LE_ADV_SCAN_IND) {
> > > +		/* Set the suggested min and max fast advertising interval,
> > > +		 * only if the peripheral device has entered any of the modes
> > > +		 * such as non-discoverable, non-connectable or limited-
> > > +		 * discoverable.
> > > +		 */
> > > +		if (!hci_dev_test_flag(hdev, HCI_DISCOVERABLE) ||
> > > +			!hci_dev_test_flag(hdev, HCI_CONNECTABLE) ||
> > > +			hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE))
> > > {
> > > +			cp.min_interval =
> > > +				cpu_to_le16(DISCOV_LE_FAST_ADV_INT_MIN);
> > > +			cp.max_interval =
> > > +
> > > 	cpu_to_le16(DISCOV_LE_FAST_ADV_INT_MAX);
> > > +		}
> > > +	}
> > > +
> > >  	cp.own_address_type = own_addr_type;
> > >  	cp.channel_map = hdev->le_adv_channel_map;
> > >
> > > --
> > > 1.9.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-15 18:48 [Bluez-users] Multiple Bluetooth connections Pedro Monjo Florit
2005-03-15 19:27 ` sir
2005-03-16  9:42 ` Marcel Holtmann
2005-03-16 11:23   ` Pedro Monjo Florit
2005-03-16 11:44     ` Marcel Holtmann
     [not found]   ` <marcel@holtmann.org>
2005-03-16 10:40     ` Peter Stephenson
2018-10-30 10:24     ` [PATCH v2] Bluetooth: Support fast advertising interval Bharat Bhusan Panda
2018-11-13  9:00       ` Panda, Bharat B
2018-11-23 10:52         ` Panda, Bharat B
2018-12-07 12:34           ` Panda, Bharat B

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable: git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org linux-bluetooth@archiver.kernel.org
	public-inbox-index linux-bluetooth


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/ public-inbox