2020-09-29 10:56:51

by Yun-hao Chung

[permalink] [raw]
Subject: [BlueZ PATCH v5 1/3] core: Add params to set interleaving durations

This patch adds parameters to control the durations of allowlist scan
and no-filter scan when the kernel is doing interleaving scan.
---

Changes in v5:
- Fix compile warning

Changes in v4:
- Change type of EnableAdvMonInterleaveScan default to u8
- Add a patch for doc/mgmt-api.txt

Changes in v3:
- Set EnableAdvMonInterleaveScan default to Disable

Changes in v2:
- Fix typo in the commit title

src/adapter.c | 18 ++++++++++++++++++
src/hcid.h | 3 +++
src/main.c | 10 ++++++++++
src/main.conf | 7 +++++++
4 files changed, 38 insertions(+)

diff --git a/src/adapter.c b/src/adapter.c
index c0053000ac19..f072541aad35 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -4418,6 +4418,24 @@ static void load_default_system_params(struct btd_adapter *adapter)
len += sizeof(params[i].u16);
}

+ if (main_opts.default_params.advmon_allowlist_scan_duration) {
+ params[i].entry.type = 0x001d;
+ params[i].entry.length = sizeof(params[i].u16);
+ params[i].u16 =
+ main_opts.default_params.advmon_allowlist_scan_duration;
+ ++i;
+ len += sizeof(params[i].u16);
+ }
+
+ if (main_opts.default_params.advmon_no_filter_scan_duration) {
+ params[i].entry.type = 0x001e;
+ params[i].entry.length = sizeof(params[i].u16);
+ params[i].u16 =
+ main_opts.default_params.advmon_no_filter_scan_duration;
+ ++i;
+ len += sizeof(params[i].u16);
+ }
+
err = mgmt_send(adapter->mgmt, MGMT_OP_SET_DEF_SYSTEM_CONFIG,
adapter->dev_id, len, params, NULL, NULL, NULL);
if (!err)
diff --git a/src/hcid.h b/src/hcid.h
index 95d4b9665193..713eab8e03ae 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -80,6 +80,9 @@ struct main_opts {
uint16_t le_conn_latency;
uint16_t le_conn_lsto;
uint16_t le_autoconnect_timeout;
+
+ uint16_t advmon_allowlist_scan_duration;
+ uint16_t advmon_no_filter_scan_duration;
} default_params;


diff --git a/src/main.c b/src/main.c
index 77be776686a8..38f193a093df 100644
--- a/src/main.c
+++ b/src/main.c
@@ -110,6 +110,8 @@ static const char *controller_options[] = {
"LEConnectionLatency",
"LEConnectionSupervisionTimeout",
"LEAutoconnecttimeout",
+ "AdvMonAllowlistScanDuration",
+ "AdvMonNoFilterScanDuration",
NULL
};

@@ -421,6 +423,14 @@ static void parse_controller_config(GKeyFile *config)
&main_opts.default_params.le_autoconnect_timeout,
0x0001,
0x4000},
+ { "AdvMonAllowlistScanDuration",
+ &main_opts.default_params.advmon_allowlist_scan_duration,
+ 1,
+ 10000},
+ { "AdvMonNoFilterScanDuration",
+ &main_opts.default_params.advmon_no_filter_scan_duration,
+ 1,
+ 10000},
};
uint16_t i;

diff --git a/src/main.conf b/src/main.conf
index 8d85702d4316..3b341f44c9cf 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -152,6 +152,13 @@
#LEConnectionSupervisionTimeout=
#LEAutoconnecttimeout=

+# Scan duration during interleaving scan. Only used when scanning for ADV
+# monitors. The units are msec.
+# Default: 300
+#AdvMonAllowlistScanDuration=
+# Default: 500
+#AdvMonNoFilterScanDuration=
+
[GATT]
# GATT attribute cache.
# Possible values:
--
2.28.0.709.gb0816b6eb0-goog


2020-09-29 10:56:51

by Yun-hao Chung

[permalink] [raw]
Subject: [BlueZ PATCH v5 2/3] core: Add param to disable interleave scan

This patch adds parameter to enable/disable the interleave scan feature.
---

Changes in v5:
- Fix compile warning

Changes in v4:
- Set type of EnableAdvMonInterleaveScan to u8
- Add support of different sizes of parameters

Changes in v3:
- Set EnableAdvMonInterleaveScan default to Disable

src/adapter.c | 10 ++++++++++
src/hcid.h | 1 +
src/main.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
src/main.conf | 6 ++++++
4 files changed, 60 insertions(+), 2 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index f072541aad35..553db4aa8b1f 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -4169,6 +4169,7 @@ static void load_default_system_params(struct btd_adapter *adapter)
struct mgmt_tlv entry;
union {
uint16_t u16;
+ uint8_t u8;
};
} __packed *params;
uint16_t i = 0;
@@ -4436,6 +4437,15 @@ static void load_default_system_params(struct btd_adapter *adapter)
len += sizeof(params[i].u16);
}

+ if (main_opts.default_params.enable_advmon_interleave_scan != 0xFF) {
+ params[i].entry.type = 0x001f;
+ params[i].entry.length = sizeof(params[i].u8);
+ params[i].u8 =
+ main_opts.default_params.enable_advmon_interleave_scan;
+ ++i;
+ len += sizeof(params[i].u8);
+ }
+
err = mgmt_send(adapter->mgmt, MGMT_OP_SET_DEF_SYSTEM_CONFIG,
adapter->dev_id, len, params, NULL, NULL, NULL);
if (!err)
diff --git a/src/hcid.h b/src/hcid.h
index 713eab8e03ae..34d22b3470f9 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -83,6 +83,7 @@ struct main_opts {

uint16_t advmon_allowlist_scan_duration;
uint16_t advmon_no_filter_scan_duration;
+ uint8_t enable_advmon_interleave_scan;
} default_params;


diff --git a/src/main.c b/src/main.c
index 38f193a093df..274af6bdcc0f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -112,6 +112,7 @@ static const char *controller_options[] = {
"LEAutoconnecttimeout",
"AdvMonAllowlistScanDuration",
"AdvMonNoFilterScanDuration",
+ "EnableAdvMonInterleaveScan",
NULL
};

@@ -307,130 +308,169 @@ static void parse_controller_config(GKeyFile *config)
{
static const struct {
const char * const val_name;
- uint16_t * const val;
+ void * const val;
+ const size_t size;
const uint16_t min;
const uint16_t max;
} params[] = {
{ "BRPageScanType",
&main_opts.default_params.br_page_scan_type,
+ sizeof(main_opts.default_params.br_page_scan_type),
0,
1},
{ "BRPageScanInterval",
&main_opts.default_params.br_page_scan_interval,
+ sizeof(main_opts.default_params.br_page_scan_interval),
0x0012,
0x1000},
{ "BRPageScanWindow",
&main_opts.default_params.br_page_scan_win,
+ sizeof(main_opts.default_params.br_page_scan_win),
0x0011,
0x1000},
{ "BRInquiryScanType",
&main_opts.default_params.br_scan_type,
+ sizeof(main_opts.default_params.br_scan_type),
0,
1},
{ "BRInquiryScanInterval",
&main_opts.default_params.br_scan_interval,
+ sizeof(main_opts.default_params.br_scan_interval),
0x0012,
0x1000},
{ "BRInquiryScanWindow",
&main_opts.default_params.br_scan_win,
+ sizeof(main_opts.default_params.br_scan_win),
0x0011,
0x1000},
{ "BRLinkSupervisionTimeout",
&main_opts.default_params.br_link_supervision_timeout,
+ sizeof(main_opts.default_params.br_link_supervision_timeout),
0x0001,
0xFFFF},
{ "BRPageTimeout",
&main_opts.default_params.br_page_timeout,
+ sizeof(main_opts.default_params.br_page_scan_win),
0x0001,
0xFFFF},
{ "BRMinSniffInterval",
&main_opts.default_params.br_min_sniff_interval,
+ sizeof(main_opts.default_params.br_min_sniff_interval),
0x0001,
0xFFFE},
{ "BRMaxSniffInterval",
&main_opts.default_params.br_max_sniff_interval,
+ sizeof(main_opts.default_params.br_max_sniff_interval),
0x0001,
0xFFFE},
{ "LEMinAdvertisementInterval",
&main_opts.default_params.le_min_adv_interval,
+ sizeof(main_opts.default_params.le_min_adv_interval),
0x0020,
0x4000},
{ "LEMaxAdvertisementInterval",
&main_opts.default_params.le_max_adv_interval,
+ sizeof(main_opts.default_params.le_max_adv_interval),
0x0020,
0x4000},
{ "LEMultiAdvertisementRotationInterval",
&main_opts.default_params.le_multi_adv_rotation_interval,
+ sizeof(main_opts.default_params.
+ le_multi_adv_rotation_interval),
0x0001,
0xFFFF},
{ "LEScanIntervalAutoConnect",
&main_opts.default_params.le_scan_interval_autoconnect,
+ sizeof(main_opts.default_params.le_scan_interval_autoconnect),
0x0004,
0x4000},
{ "LEScanWindowAutoConnect",
&main_opts.default_params.le_scan_win_autoconnect,
+ sizeof(main_opts.default_params.le_scan_win_autoconnect),
0x0004,
0x4000},
{ "LEScanIntervalSuspend",
&main_opts.default_params.le_scan_interval_suspend,
+ sizeof(main_opts.default_params.le_scan_interval_suspend),
0x0004,
0x4000},
{ "LEScanWindowSuspend",
&main_opts.default_params.le_scan_win_suspend,
+ sizeof(main_opts.default_params.le_scan_win_suspend),
0x0004,
0x4000},
{ "LEScanIntervalDiscovery",
&main_opts.default_params.le_scan_interval_discovery,
+ sizeof(main_opts.default_params.le_scan_interval_discovery),
0x0004,
0x4000},
{ "LEScanWindowDiscovery",
&main_opts.default_params.le_scan_win_discovery,
+ sizeof(main_opts.default_params.le_scan_win_discovery),
0x0004,
0x4000},
{ "LEScanIntervalAdvMonitor",
&main_opts.default_params.le_scan_interval_adv_monitor,
+ sizeof(main_opts.default_params.le_scan_interval_adv_monitor),
0x0004,
0x4000},
{ "LEScanWindowAdvMonitor",
&main_opts.default_params.le_scan_win_adv_monitor,
+ sizeof(main_opts.default_params.le_scan_win_adv_monitor),
0x0004,
0x4000},
{ "LEScanIntervalConnect",
&main_opts.default_params.le_scan_interval_connect,
+ sizeof(main_opts.default_params.le_scan_interval_connect),
0x0004,
0x4000},
{ "LEScanWindowConnect",
&main_opts.default_params.le_scan_win_connect,
+ sizeof(main_opts.default_params.le_scan_win_connect),
0x0004,
0x4000},
{ "LEMinConnectionInterval",
&main_opts.default_params.le_min_conn_interval,
+ sizeof(main_opts.default_params.le_min_conn_interval),
0x0006,
0x0C80},
{ "LEMaxConnectionInterval",
&main_opts.default_params.le_max_conn_interval,
+ sizeof(main_opts.default_params.le_max_conn_interval),
0x0006,
0x0C80},
{ "LEConnectionLatency",
&main_opts.default_params.le_conn_latency,
+ sizeof(main_opts.default_params.le_conn_latency),
0x0000,
0x01F3},
{ "LEConnectionSupervisionTimeout",
&main_opts.default_params.le_conn_lsto,
+ sizeof(main_opts.default_params.le_conn_lsto),
0x000A,
0x0C80},
{ "LEAutoconnecttimeout",
&main_opts.default_params.le_autoconnect_timeout,
+ sizeof(main_opts.default_params.le_autoconnect_timeout),
0x0001,
0x4000},
{ "AdvMonAllowlistScanDuration",
&main_opts.default_params.advmon_allowlist_scan_duration,
+ sizeof(main_opts.default_params.
+ advmon_allowlist_scan_duration),
1,
10000},
{ "AdvMonNoFilterScanDuration",
&main_opts.default_params.advmon_no_filter_scan_duration,
+ sizeof(main_opts.default_params.br_page_scan_win),
1,
10000},
+ { "EnableAdvMonInterleaveScan",
+ &main_opts.default_params.enable_advmon_interleave_scan,
+ sizeof(main_opts.default_params.
+ enable_advmon_interleave_scan),
+ 0,
+ 1},
};
uint16_t i;

@@ -449,7 +489,7 @@ static void parse_controller_config(GKeyFile *config)

val = MAX(val, params[i].min);
val = MIN(val, params[i].max);
- *params[i].val = val;
+ memcpy(params[i].val, &val, params[i].size);
++main_opts.default_params.num_entries;
}
}
@@ -698,6 +738,7 @@ static void init_defaults(void)
main_opts.default_params.num_entries = 0;
main_opts.default_params.br_page_scan_type = 0xFFFF;
main_opts.default_params.br_scan_type = 0xFFFF;
+ main_opts.default_params.enable_advmon_interleave_scan = 0xFF;

if (sscanf(VERSION, "%hhu.%hhu", &major, &minor) != 2)
return;
diff --git a/src/main.conf b/src/main.conf
index 3b341f44c9cf..82ffc5813204 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -159,6 +159,12 @@
# Default: 500
#AdvMonNoFilterScanDuration=

+# Enable/Disable Advertisement Monitor interleave scan for power saving.
+# 0: disable
+# 1: enable
+# Defaults to 0
+#EnableAdvMonInterleaveScan=
+
[GATT]
# GATT attribute cache.
# Possible values:
--
2.28.0.709.gb0816b6eb0-goog

2020-09-29 10:56:55

by Yun-hao Chung

[permalink] [raw]
Subject: [BlueZ PATCH v5 3/3] doc: Add definition of advmon related parameters

This adds definition of the newly added parameters for advertisment
monitor interleave scan.
---

(no changes since v1)

doc/mgmt-api.txt | 3 +++
1 file changed, 3 insertions(+)

diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt
index e7a7138249d1..45211dba7fbd 100644
--- a/doc/mgmt-api.txt
+++ b/doc/mgmt-api.txt
@@ -3279,6 +3279,9 @@ Read Default System Configuration Command
0x0019 LE Connection Latency
0x001a LE Connection Supervision Timeout
0x001b LE Autoconnect Timeout
+ 0x001d Advertisement Monitor Allowlist scan duration
+ 0x001e Advertisement Monitor No filter scan duration
+ 0x001f Enable Advertisement Monitor Interleave Scan

This command can be used at any time and will return a list of
supported default parameters as well as their current value.
--
2.28.0.709.gb0816b6eb0-goog

2020-09-29 12:31:21

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ,v5,1/3] core: Add params to set interleaving durations

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=357041

---Test result---

##############################
Test: CheckPatch - FAIL
Output:
core: Add param to disable interleave scan
WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'main_opts.default_params.le_multi_adv_rotation_interval'
#133: FILE: src/main.c:379:
+ sizeof(main_opts.default_params.
+ le_multi_adv_rotation_interval),

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'main_opts.default_params.advmon_allowlist_scan_duration'
#214: FILE: src/main.c:460:
+ sizeof(main_opts.default_params.
+ advmon_allowlist_scan_duration),

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'main_opts.default_params.enable_advmon_interleave_scan'
#225: FILE: src/main.c:471:
+ sizeof(main_opts.default_params.
+ enable_advmon_interleave_scan),

- total: 0 errors, 3 warnings, 233 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

doc: Add definition of advmon related parameters
WARNING:TYPO_SPELLING: 'advertisment' may be misspelled - perhaps 'advertisement'?
#6:
This adds definition of the newly added parameters for advertisment

- total: 0 errors, 1 warnings, 9 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: CheckGitLint - PASS

##############################
Test: CheckBuild - PASS

##############################
Test: MakeCheck - PASS



---
Regards,
Linux Bluetooth

2020-09-29 19:51:07

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [BlueZ PATCH v5 2/3] core: Add param to disable interleave scan

Hi Howard,

On Tue, Sep 29, 2020 at 3:56 AM Howard Chung <[email protected]> wrote:
>
> This patch adds parameter to enable/disable the interleave scan feature.
> ---
>
> Changes in v5:
> - Fix compile warning
>
> Changes in v4:
> - Set type of EnableAdvMonInterleaveScan to u8
> - Add support of different sizes of parameters
>
> Changes in v3:
> - Set EnableAdvMonInterleaveScan default to Disable
>
> src/adapter.c | 10 ++++++++++
> src/hcid.h | 1 +
> src/main.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
> src/main.conf | 6 ++++++
> 4 files changed, 60 insertions(+), 2 deletions(-)
>
> diff --git a/src/adapter.c b/src/adapter.c
> index f072541aad35..553db4aa8b1f 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -4169,6 +4169,7 @@ static void load_default_system_params(struct btd_adapter *adapter)
> struct mgmt_tlv entry;
> union {
> uint16_t u16;
> + uint8_t u8;
> };
> } __packed *params;
> uint16_t i = 0;
> @@ -4436,6 +4437,15 @@ static void load_default_system_params(struct btd_adapter *adapter)
> len += sizeof(params[i].u16);
> }
>
> + if (main_opts.default_params.enable_advmon_interleave_scan != 0xFF) {
> + params[i].entry.type = 0x001f;
> + params[i].entry.length = sizeof(params[i].u8);
> + params[i].u8 =
> + main_opts.default_params.enable_advmon_interleave_scan;
> + ++i;
> + len += sizeof(params[i].u8);
> + }
> +

We could perhaps have a zero length here so that just the presence of
the type indicates it should be enabled, how about that?

> err = mgmt_send(adapter->mgmt, MGMT_OP_SET_DEF_SYSTEM_CONFIG,
> adapter->dev_id, len, params, NULL, NULL, NULL);
> if (!err)
> diff --git a/src/hcid.h b/src/hcid.h
> index 713eab8e03ae..34d22b3470f9 100644
> --- a/src/hcid.h
> +++ b/src/hcid.h
> @@ -83,6 +83,7 @@ struct main_opts {
>
> uint16_t advmon_allowlist_scan_duration;
> uint16_t advmon_no_filter_scan_duration;
> + uint8_t enable_advmon_interleave_scan;
> } default_params;
>
>
> diff --git a/src/main.c b/src/main.c
> index 38f193a093df..274af6bdcc0f 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -112,6 +112,7 @@ static const char *controller_options[] = {
> "LEAutoconnecttimeout",
> "AdvMonAllowlistScanDuration",
> "AdvMonNoFilterScanDuration",
> + "EnableAdvMonInterleaveScan",
> NULL
> };
>
> @@ -307,130 +308,169 @@ static void parse_controller_config(GKeyFile *config)
> {
> static const struct {
> const char * const val_name;
> - uint16_t * const val;
> + void * const val;
> + const size_t size;
> const uint16_t min;
> const uint16_t max;
> } params[] = {
> { "BRPageScanType",
> &main_opts.default_params.br_page_scan_type,
> + sizeof(main_opts.default_params.br_page_scan_type),
> 0,
> 1},
> { "BRPageScanInterval",
> &main_opts.default_params.br_page_scan_interval,
> + sizeof(main_opts.default_params.br_page_scan_interval),
> 0x0012,
> 0x1000},
> { "BRPageScanWindow",
> &main_opts.default_params.br_page_scan_win,
> + sizeof(main_opts.default_params.br_page_scan_win),
> 0x0011,
> 0x1000},
> { "BRInquiryScanType",
> &main_opts.default_params.br_scan_type,
> + sizeof(main_opts.default_params.br_scan_type),
> 0,
> 1},
> { "BRInquiryScanInterval",
> &main_opts.default_params.br_scan_interval,
> + sizeof(main_opts.default_params.br_scan_interval),
> 0x0012,
> 0x1000},
> { "BRInquiryScanWindow",
> &main_opts.default_params.br_scan_win,
> + sizeof(main_opts.default_params.br_scan_win),
> 0x0011,
> 0x1000},
> { "BRLinkSupervisionTimeout",
> &main_opts.default_params.br_link_supervision_timeout,
> + sizeof(main_opts.default_params.br_link_supervision_timeout),
> 0x0001,
> 0xFFFF},
> { "BRPageTimeout",
> &main_opts.default_params.br_page_timeout,
> + sizeof(main_opts.default_params.br_page_scan_win),
> 0x0001,
> 0xFFFF},
> { "BRMinSniffInterval",
> &main_opts.default_params.br_min_sniff_interval,
> + sizeof(main_opts.default_params.br_min_sniff_interval),
> 0x0001,
> 0xFFFE},
> { "BRMaxSniffInterval",
> &main_opts.default_params.br_max_sniff_interval,
> + sizeof(main_opts.default_params.br_max_sniff_interval),
> 0x0001,
> 0xFFFE},
> { "LEMinAdvertisementInterval",
> &main_opts.default_params.le_min_adv_interval,
> + sizeof(main_opts.default_params.le_min_adv_interval),
> 0x0020,
> 0x4000},
> { "LEMaxAdvertisementInterval",
> &main_opts.default_params.le_max_adv_interval,
> + sizeof(main_opts.default_params.le_max_adv_interval),
> 0x0020,
> 0x4000},
> { "LEMultiAdvertisementRotationInterval",
> &main_opts.default_params.le_multi_adv_rotation_interval,
> + sizeof(main_opts.default_params.
> + le_multi_adv_rotation_interval),
> 0x0001,
> 0xFFFF},
> { "LEScanIntervalAutoConnect",
> &main_opts.default_params.le_scan_interval_autoconnect,
> + sizeof(main_opts.default_params.le_scan_interval_autoconnect),
> 0x0004,
> 0x4000},
> { "LEScanWindowAutoConnect",
> &main_opts.default_params.le_scan_win_autoconnect,
> + sizeof(main_opts.default_params.le_scan_win_autoconnect),
> 0x0004,
> 0x4000},
> { "LEScanIntervalSuspend",
> &main_opts.default_params.le_scan_interval_suspend,
> + sizeof(main_opts.default_params.le_scan_interval_suspend),
> 0x0004,
> 0x4000},
> { "LEScanWindowSuspend",
> &main_opts.default_params.le_scan_win_suspend,
> + sizeof(main_opts.default_params.le_scan_win_suspend),
> 0x0004,
> 0x4000},
> { "LEScanIntervalDiscovery",
> &main_opts.default_params.le_scan_interval_discovery,
> + sizeof(main_opts.default_params.le_scan_interval_discovery),
> 0x0004,
> 0x4000},
> { "LEScanWindowDiscovery",
> &main_opts.default_params.le_scan_win_discovery,
> + sizeof(main_opts.default_params.le_scan_win_discovery),
> 0x0004,
> 0x4000},
> { "LEScanIntervalAdvMonitor",
> &main_opts.default_params.le_scan_interval_adv_monitor,
> + sizeof(main_opts.default_params.le_scan_interval_adv_monitor),
> 0x0004,
> 0x4000},
> { "LEScanWindowAdvMonitor",
> &main_opts.default_params.le_scan_win_adv_monitor,
> + sizeof(main_opts.default_params.le_scan_win_adv_monitor),
> 0x0004,
> 0x4000},
> { "LEScanIntervalConnect",
> &main_opts.default_params.le_scan_interval_connect,
> + sizeof(main_opts.default_params.le_scan_interval_connect),
> 0x0004,
> 0x4000},
> { "LEScanWindowConnect",
> &main_opts.default_params.le_scan_win_connect,
> + sizeof(main_opts.default_params.le_scan_win_connect),
> 0x0004,
> 0x4000},
> { "LEMinConnectionInterval",
> &main_opts.default_params.le_min_conn_interval,
> + sizeof(main_opts.default_params.le_min_conn_interval),
> 0x0006,
> 0x0C80},
> { "LEMaxConnectionInterval",
> &main_opts.default_params.le_max_conn_interval,
> + sizeof(main_opts.default_params.le_max_conn_interval),
> 0x0006,
> 0x0C80},
> { "LEConnectionLatency",
> &main_opts.default_params.le_conn_latency,
> + sizeof(main_opts.default_params.le_conn_latency),
> 0x0000,
> 0x01F3},
> { "LEConnectionSupervisionTimeout",
> &main_opts.default_params.le_conn_lsto,
> + sizeof(main_opts.default_params.le_conn_lsto),
> 0x000A,
> 0x0C80},
> { "LEAutoconnecttimeout",
> &main_opts.default_params.le_autoconnect_timeout,
> + sizeof(main_opts.default_params.le_autoconnect_timeout),
> 0x0001,
> 0x4000},
> { "AdvMonAllowlistScanDuration",
> &main_opts.default_params.advmon_allowlist_scan_duration,
> + sizeof(main_opts.default_params.
> + advmon_allowlist_scan_duration),
> 1,
> 10000},
> { "AdvMonNoFilterScanDuration",
> &main_opts.default_params.advmon_no_filter_scan_duration,
> + sizeof(main_opts.default_params.br_page_scan_win),
> 1,
> 10000},
> + { "EnableAdvMonInterleaveScan",
> + &main_opts.default_params.enable_advmon_interleave_scan,
> + sizeof(main_opts.default_params.
> + enable_advmon_interleave_scan),
> + 0,
> + 1},
> };
> uint16_t i;
>
> @@ -449,7 +489,7 @@ static void parse_controller_config(GKeyFile *config)
>
> val = MAX(val, params[i].min);
> val = MIN(val, params[i].max);
> - *params[i].val = val;
> + memcpy(params[i].val, &val, params[i].size);
> ++main_opts.default_params.num_entries;
> }
> }
> @@ -698,6 +738,7 @@ static void init_defaults(void)
> main_opts.default_params.num_entries = 0;
> main_opts.default_params.br_page_scan_type = 0xFFFF;
> main_opts.default_params.br_scan_type = 0xFFFF;
> + main_opts.default_params.enable_advmon_interleave_scan = 0xFF;
>
> if (sscanf(VERSION, "%hhu.%hhu", &major, &minor) != 2)
> return;
> diff --git a/src/main.conf b/src/main.conf
> index 3b341f44c9cf..82ffc5813204 100644
> --- a/src/main.conf
> +++ b/src/main.conf
> @@ -159,6 +159,12 @@
> # Default: 500
> #AdvMonNoFilterScanDuration=
>
> +# Enable/Disable Advertisement Monitor interleave scan for power saving.
> +# 0: disable
> +# 1: enable
> +# Defaults to 0
> +#EnableAdvMonInterleaveScan=
> +
> [GATT]
> # GATT attribute cache.
> # Possible values:
> --
> 2.28.0.709.gb0816b6eb0-goog
>


--
Luiz Augusto von Dentz