adv_monitor: Fix spamming errors

If advertising manager is not enabled don't log any error on
btd_adapter_update_found_device, also change
btd_adv_monitor_offload_supported to btd_adv_monitor_offload_enabled
since that is checking if the features has been enabled rather than it
is just supported.

Fixes: https://github.com/bluez/bluez/issues/286
This commit is contained in:
Luiz Augusto von Dentz 2022-02-08 13:02:13 -08:00
parent 19448b9cb8
commit 264177eb4a
3 changed files with 4 additions and 6 deletions

View File

@ -6892,7 +6892,7 @@ void btd_adapter_update_found_device(struct btd_adapter *adapter,
bool duplicate = false; bool duplicate = false;
struct queue *matched_monitors = NULL; struct queue *matched_monitors = NULL;
if (!btd_adv_monitor_offload_supported(adapter->adv_monitor_manager)) { if (!btd_adv_monitor_offload_enabled(adapter->adv_monitor_manager)) {
if (bdaddr_type != BDADDR_BREDR) if (bdaddr_type != BDADDR_BREDR)
ad = bt_ad_new_with_data(data_len, data); ad = bt_ad_new_with_data(data_len, data);

View File

@ -1844,12 +1844,10 @@ void btd_adv_monitor_manager_destroy(struct btd_adv_monitor_manager *manager)
manager_destroy(manager); manager_destroy(manager);
} }
bool btd_adv_monitor_offload_supported(struct btd_adv_monitor_manager *manager) bool btd_adv_monitor_offload_enabled(struct btd_adv_monitor_manager *manager)
{ {
if (!manager) { if (!manager)
error("Manager is NULL, get offload support failed");
return false; return false;
}
return !!(manager->enabled_features & return !!(manager->enabled_features &
MGMT_ADV_MONITOR_FEATURE_MASK_OR_PATTERNS); MGMT_ADV_MONITOR_FEATURE_MASK_OR_PATTERNS);

View File

@ -27,7 +27,7 @@ struct btd_adv_monitor_manager *btd_adv_monitor_manager_create(
struct mgmt *mgmt); struct mgmt *mgmt);
void btd_adv_monitor_manager_destroy(struct btd_adv_monitor_manager *manager); void btd_adv_monitor_manager_destroy(struct btd_adv_monitor_manager *manager);
bool btd_adv_monitor_offload_supported(struct btd_adv_monitor_manager *manager); bool btd_adv_monitor_offload_enabled(struct btd_adv_monitor_manager *manager);
struct queue *btd_adv_monitor_content_filter( struct queue *btd_adv_monitor_content_filter(
struct btd_adv_monitor_manager *manager, struct btd_adv_monitor_manager *manager,