The existing code assumes that, if a device supports advertising monitor
offload, DEVICE_FOUND events can be ignored since the kernel will send
ADV_MONITOR_DEVICE_FOUND events instead. Unfortunately, these new events
were added in 5.18, but offload was added in 5.12. This patch adds a
check on the MGMT API version so we can process the older DEVICE_FOUND
events when the new events are not supported.
Fixes: https://github.com/bluez/bluez/issues/357
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
struct queue *matched_monitors = NULL;
- if (!btd_adv_monitor_offload_enabled(adapter->adv_monitor_manager)) {
+ if (!btd_adv_monitor_offload_enabled(adapter->adv_monitor_manager) ||
+ (MGMT_VERSION(mgmt_version, mgmt_revision) <
+ MGMT_VERSION(1, 22))) {
if (bdaddr_type != BDADDR_BREDR)
ad = bt_ad_new_with_data(data_len, data);