* [PATCH 1/2] Improve the logic when emitting Discovering signal
@ 2011-03-29 19:26 Claudio Takahasi
2011-03-29 19:26 ` [PATCH 2/2] Add constant for interleaved discovery window Claudio Takahasi
2011-03-30 16:42 ` [PATCH 1/2] Improve the logic when emitting Discovering signal Johan Hedberg
0 siblings, 2 replies; 6+ messages in thread
From: Claudio Takahasi @ 2011-03-29 19:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
src/adapter.c | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index 031e141..69fd5be 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2826,19 +2826,18 @@ void adapter_set_state(struct btd_adapter *adapter, int state)
return;
break;
case STATE_LE_SCAN:
- /* Scanning enabled */
- if (adapter->disc_sessions) {
- adapter->stop_discov_id = g_timeout_add(5120,
- stop_scanning,
- adapter);
+ discov_active = TRUE;
- /* For dual mode: don't send "Discovering = TRUE" */
- if (bredr_capable(adapter) == TRUE)
- return;
- }
+ if (!adapter->disc_sessions)
+ break;
- /* LE only */
- discov_active = TRUE;
+ /* Scanning enabled */
+ adapter->stop_discov_id = g_timeout_add(5120, stop_scanning,
+ adapter);
+
+ /* For dual mode: don't send "Discovering = TRUE" */
+ if (bredr_capable(adapter) == TRUE)
+ return;
break;
case STATE_IDLE:
--
1.7.4.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/2] Add constant for interleaved discovery window
2011-03-29 19:26 [PATCH 1/2] Improve the logic when emitting Discovering signal Claudio Takahasi
@ 2011-03-29 19:26 ` Claudio Takahasi
2011-03-30 16:42 ` Johan Hedberg
2011-03-30 16:42 ` [PATCH 1/2] Improve the logic when emitting Discovering signal Johan Hedberg
1 sibling, 1 reply; 6+ messages in thread
From: Claudio Takahasi @ 2011-03-29 19:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
src/adapter.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index 69fd5be..32ec71d 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -59,6 +59,9 @@
#include "attrib-server.h"
#include "att.h"
+/* Interleaved discovery window: 5.12 sec */
+#define GAP_INTER_DISCOV_WIN 5120
+
/* Flags Descriptions */
#define EIR_LIM_DISC 0x01 /* LE Limited Discoverable Mode */
#define EIR_GEN_DISC 0x02 /* LE General Discoverable Mode */
@@ -2831,11 +2834,12 @@ void adapter_set_state(struct btd_adapter *adapter, int state)
if (!adapter->disc_sessions)
break;
- /* Scanning enabled */
- adapter->stop_discov_id = g_timeout_add(5120, stop_scanning,
+ /* Stop scanning after TGAP(100)/2 */
+ adapter->stop_discov_id = g_timeout_add(GAP_INTER_DISCOV_WIN,
+ stop_scanning,
adapter);
- /* For dual mode: don't send "Discovering = TRUE" */
+ /* For dual mode: don't send "Discovering = TRUE" (twice) */
if (bredr_capable(adapter) == TRUE)
return;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] Add constant for interleaved discovery window
2011-03-29 19:26 ` [PATCH 2/2] Add constant for interleaved discovery window Claudio Takahasi
@ 2011-03-30 16:42 ` Johan Hedberg
2011-03-30 16:48 ` [PATCH v2 " Claudio Takahasi
0 siblings, 1 reply; 6+ messages in thread
From: Johan Hedberg @ 2011-03-30 16:42 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
Hi Claudio,
On Tue, Mar 29, 2011, Claudio Takahasi wrote:
> ---
> src/adapter.c | 10 +++++++---
> 1 files changed, 7 insertions(+), 3 deletions(-)
This one doesn't apply. Please fix and resend.
Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] Add constant for interleaved discovery window
2011-03-30 16:42 ` Johan Hedberg
@ 2011-03-30 16:48 ` Claudio Takahasi
2011-03-30 20:47 ` Johan Hedberg
0 siblings, 1 reply; 6+ messages in thread
From: Claudio Takahasi @ 2011-03-30 16:48 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
src/adapter.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index 4ce7e4c..1d236ca 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -61,6 +61,9 @@
#include "gattrib.h"
#include "attrib/client.h"
+/* Interleaved discovery window: 5.12 sec */
+#define GAP_INTER_DISCOV_WIN 5120
+
/* Flags Descriptions */
#define EIR_LIM_DISC 0x01 /* LE Limited Discoverable Mode */
#define EIR_GEN_DISC 0x02 /* LE General Discoverable Mode */
@@ -2836,11 +2839,12 @@ void adapter_set_state(struct btd_adapter *adapter, int state)
if (!adapter->disc_sessions)
break;
- /* Scanning enabled */
- adapter->stop_discov_id = g_timeout_add(5120, stop_scanning,
+ /* Stop scanning after TGAP(100)/2 */
+ adapter->stop_discov_id = g_timeout_add(GAP_INTER_DISCOV_WIN,
+ stop_scanning,
adapter);
- /* For dual mode: don't send "Discovering = TRUE" */
+ /* For dual mode: don't send "Discovering = TRUE" (twice) */
if (bredr_capable(adapter) == TRUE)
return;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] Improve the logic when emitting Discovering signal
2011-03-29 19:26 [PATCH 1/2] Improve the logic when emitting Discovering signal Claudio Takahasi
2011-03-29 19:26 ` [PATCH 2/2] Add constant for interleaved discovery window Claudio Takahasi
@ 2011-03-30 16:42 ` Johan Hedberg
1 sibling, 0 replies; 6+ messages in thread
From: Johan Hedberg @ 2011-03-30 16:42 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
Hi Claudio,
On Tue, Mar 29, 2011, Claudio Takahasi wrote:
> ---
> src/adapter.c | 21 ++++++++++-----------
> 1 files changed, 10 insertions(+), 11 deletions(-)
Pushed upstream. Thanks.
Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-03-30 20:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-29 19:26 [PATCH 1/2] Improve the logic when emitting Discovering signal Claudio Takahasi
2011-03-29 19:26 ` [PATCH 2/2] Add constant for interleaved discovery window Claudio Takahasi
2011-03-30 16:42 ` Johan Hedberg
2011-03-30 16:48 ` [PATCH v2 " Claudio Takahasi
2011-03-30 20:47 ` Johan Hedberg
2011-03-30 16:42 ` [PATCH 1/2] Improve the logic when emitting Discovering signal Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox