diff mbox series

[BlueZ,v5,6/6] core: Update default advmon Sampling_Period to 0xFF

Message ID 20211117110627.BlueZ.v5.6.I363090b80e59a3cda134c9bd2df0b3bca2cb527b@changeid (mailing list archive)
State Superseded
Headers show
Series [BlueZ,v5,1/6] doc: Introduce the Adv Monitor Device Found/Lost events | expand

Checks

Context Check Description
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS

Commit Message

Manish Mandlik Nov. 17, 2021, 7:14 p.m. UTC
Update default Advertisemet Monitor Sampling_Period to 0xFF. It
indicates that controller will report only one advertisement per
monitoring period for a device. This will help reduce the power
consumption drastically.

Reviewed-by: Miao-chen Chou <mcchou@google.com>
---

Changes in v5:
- New patch in the series. Update default Sampling_Period to 0xFF.

 src/main.c    | 2 +-
 src/main.conf | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Luiz Augusto von Dentz Nov. 17, 2021, 9:09 p.m. UTC | #1
Hi Manish,

On Wed, Nov 17, 2021 at 11:15 AM Manish Mandlik <mmandlik@google.com> wrote:
>
> Update default Advertisemet Monitor Sampling_Period to 0xFF. It
> indicates that controller will report only one advertisement per
> monitoring period for a device. This will help reduce the power
> consumption drastically.
>
> Reviewed-by: Miao-chen Chou <mcchou@google.com>
> ---
>
> Changes in v5:
> - New patch in the series. Update default Sampling_Period to 0xFF.
>
>  src/main.c    | 2 +-
>  src/main.conf | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/main.c b/src/main.c
> index 5ca8d5644..1f852fdf6 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -932,7 +932,7 @@ static void init_defaults(void)
>         btd_opts.avdtp.session_mode = BT_IO_MODE_BASIC;
>         btd_opts.avdtp.stream_mode = BT_IO_MODE_BASIC;
>
> -       btd_opts.advmon.rssi_sampling_period = 0;
> +       btd_opts.advmon.rssi_sampling_period = 0xFF;
>  }
>
>  static void log_handler(const gchar *log_domain, GLogLevelFlags log_level,
> diff --git a/src/main.conf b/src/main.conf
> index e05291d8e..e49259453 100644
> --- a/src/main.conf
> +++ b/src/main.conf
> @@ -260,5 +260,5 @@
>  [AdvMon]
>  # Default RSSI Sampling Period. This is used when a client registers an
>  # advertisement monitor and leaves the RSSISamplingPeriod unset.
> -# Default: 0
> +# Default: 0xFF (Report only one Adv per device during the monitoring period)
>  #RSSISamplingPeriod=0

While at it it would be good to explain what is the unit used here,
also it is common practice to have the default on the commented entry.

> --
> 2.34.0.rc1.387.gb447b232ab-goog
>
Luiz Augusto von Dentz Nov. 19, 2021, 7:40 p.m. UTC | #2
Hi Manish,

On Fri, Nov 19, 2021 at 11:06 AM Manish Mandlik <mmandlik@google.com> wrote:
>
> Hi Luiz,
>
>
> On Wed, Nov 17, 2021 at 4:09 PM Luiz Augusto von Dentz <luiz.dentz@gmail.com> wrote:
>>
>> Hi Manish,
>>
>> On Wed, Nov 17, 2021 at 11:15 AM Manish Mandlik <mmandlik@google.com> wrote:
>> >
>> > Update default Advertisemet Monitor Sampling_Period to 0xFF. It
>> > indicates that controller will report only one advertisement per
>> > monitoring period for a device. This will help reduce the power
>> > consumption drastically.
>> >
>> > Reviewed-by: Miao-chen Chou <mcchou@google.com>
>> > ---
>> >
>> > Changes in v5:
>> > - New patch in the series. Update default Sampling_Period to 0xFF.
>> >
>> >  src/main.c    | 2 +-
>> >  src/main.conf | 2 +-
>> >  2 files changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/src/main.c b/src/main.c
>> > index 5ca8d5644..1f852fdf6 100644
>> > --- a/src/main.c
>> > +++ b/src/main.c
>> > @@ -932,7 +932,7 @@ static void init_defaults(void)
>> >         btd_opts.avdtp.session_mode = BT_IO_MODE_BASIC;
>> >         btd_opts.avdtp.stream_mode = BT_IO_MODE_BASIC;
>> >
>> > -       btd_opts.advmon.rssi_sampling_period = 0;
>> > +       btd_opts.advmon.rssi_sampling_period = 0xFF;
>> >  }
>> >
>> >  static void log_handler(const gchar *log_domain, GLogLevelFlags log_level,
>> > diff --git a/src/main.conf b/src/main.conf
>> > index e05291d8e..e49259453 100644
>> > --- a/src/main.conf
>> > +++ b/src/main.conf
>> > @@ -260,5 +260,5 @@
>> >  [AdvMon]
>> >  # Default RSSI Sampling Period. This is used when a client registers an
>> >  # advertisement monitor and leaves the RSSISamplingPeriod unset.
>> > -# Default: 0
>> > +# Default: 0xFF (Report only one Adv per device during the monitoring period)
>> >  #RSSISamplingPeriod=0
>>
>> While at it it would be good to explain what is the unit used here,
>> also it is common practice to have the default on the commented entry.
>
> Ack. I'll update this in the next revision.
>
>>
>>
>> > --
>> > 2.34.0.rc1.387.gb447b232ab-goog
>> >
>>
>>
>> --
>> Luiz Augusto von Dentz
>
>
> Can you please review the other patches as well and let me know if they look good? I'll send all the required changes in the next revision together.

Other patches look good.
diff mbox series

Patch

diff --git a/src/main.c b/src/main.c
index 5ca8d5644..1f852fdf6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -932,7 +932,7 @@  static void init_defaults(void)
 	btd_opts.avdtp.session_mode = BT_IO_MODE_BASIC;
 	btd_opts.avdtp.stream_mode = BT_IO_MODE_BASIC;
 
-	btd_opts.advmon.rssi_sampling_period = 0;
+	btd_opts.advmon.rssi_sampling_period = 0xFF;
 }
 
 static void log_handler(const gchar *log_domain, GLogLevelFlags log_level,
diff --git a/src/main.conf b/src/main.conf
index e05291d8e..e49259453 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -260,5 +260,5 @@ 
 [AdvMon]
 # Default RSSI Sampling Period. This is used when a client registers an
 # advertisement monitor and leaves the RSSISamplingPeriod unset.
-# Default: 0
+# Default: 0xFF (Report only one Adv per device during the monitoring period)
 #RSSISamplingPeriod=0