diff options
author | Yun-Hao Chung <howardchung@chromium.org> | 2021-05-24 10:43:37 +0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-05-24 13:14:24 -0700 |
commit | 2501575a73d0c434ffa02d62d4d1f9c0584bf01d (patch) | |
tree | 028427d4bfc1233c0b1c93aa3b9f75af443b631c /src/main.c | |
parent | af77ecf57c5d02c43f13133b49270f2253e7fdc9 (diff) | |
download | bluez-2501575a73d0c434ffa02d62d4d1f9c0584bf01d.tar.gz |
core: Add RSSI sampling period in system parameter
Add an option in main.conf to configure the default RSSI sampling
period for advertisement monitor.
Reviewed-by: apusaka@chromium.org
Reviewed-by: mmandlik@chromium.org
Reviewed-by: mcchou@chromium.org
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index 57db9c134..516509e3f 100644 --- a/src/main.c +++ b/src/main.c @@ -145,6 +145,11 @@ static const char *avdtp_options[] = { NULL }; +static const char *advmon_options[] = { + "RSSISamplingPeriod", + NULL +}; + static const struct group_table { const char *name; const char **options; @@ -155,6 +160,7 @@ static const struct group_table { { "Policy", policy_options }, { "GATT", gatt_options }, { "AVDTP", avdtp_options }, + { "AdvMon", advmon_options }, { } }; @@ -802,6 +808,18 @@ static void parse_config(GKeyFile *config) g_free(str); } + val = g_key_file_get_integer(config, "AdvMon", "RSSISamplingPeriod", + &err); + if (err) { + DBG("%s", err->message); + g_clear_error(&err); + } else { + val = MIN(val, 0xFF); + val = MAX(val, 0); + DBG("RSSISamplingPeriod=%d", val); + btd_opts.advmon.rssi_sampling_period = val; + } + parse_br_config(config); parse_le_config(config); } @@ -842,6 +860,8 @@ 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; } static void log_handler(const gchar *log_domain, GLogLevelFlags log_level, |