--- 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 -- 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