Loading system/bta/csis/csis_client.cc +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1171,7 +1171,7 @@ class CsisClientImpl : public CsisClient { void CsisActiveObserverSet(bool enable) { void CsisActiveObserverSet(bool enable) { LOG(INFO) << __func__ << " CSIS Discovery SET: " << enable; LOG(INFO) << __func__ << " CSIS Discovery SET: " << enable; bluetooth::shim::set_ad_type_rsi_filter(enable); bluetooth::shim::set_empty_filter(enable); BTA_DmBleCsisObserve( BTA_DmBleCsisObserve( enable, [](tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH* p_data) { enable, [](tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH* p_data) { /* If there's no instance we are most likely shutting /* If there's no instance we are most likely shutting Loading system/main/shim/le_scanning_manager.cc +19 −0 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,8 @@ constexpr char kBtmLogTag[] = "SCAN"; constexpr uint16_t kAllowADTypeFilter = 0x80; constexpr uint16_t kAllowADTypeFilter = 0x80; constexpr uint8_t kFilterLogicOr = 0x00; constexpr uint8_t kFilterLogicOr = 0x00; constexpr uint8_t kLowestRssiValue = 129; constexpr uint8_t kLowestRssiValue = 129; constexpr uint16_t kAllowAllFilter = 0x00; constexpr uint16_t kListLogicOr = 0x01; class DefaultScanningCallback : public ::ScanningCallbacks { class DefaultScanningCallback : public ::ScanningCallbacks { void OnScannerRegistered(const bluetooth::Uuid app_uuid, uint8_t scanner_id, void OnScannerRegistered(const bluetooth::Uuid app_uuid, uint8_t scanner_id, Loading Loading @@ -749,3 +751,20 @@ void bluetooth::shim::set_ad_type_rsi_filter(bool enable) { bluetooth::hci::ApcfAction::ADD, 0x00, advertising_filter_parameter); bluetooth::hci::ApcfAction::ADD, 0x00, advertising_filter_parameter); } } } } void bluetooth::shim::set_empty_filter(bool enable) { bluetooth::hci::AdvertisingFilterParameter advertising_filter_parameter; bluetooth::shim::GetScanning()->ScanFilterParameterSetup( bluetooth::hci::ApcfAction::DELETE, 0x00, advertising_filter_parameter); if (enable) { /* Add an allow-all filter on index 0 */ advertising_filter_parameter.delivery_mode = bluetooth::hci::DeliveryMode::IMMEDIATE; advertising_filter_parameter.feature_selection = kAllowAllFilter; advertising_filter_parameter.list_logic_type = kListLogicOr; advertising_filter_parameter.filter_logic_type = kFilterLogicOr; advertising_filter_parameter.rssi_high_thresh = kLowestRssiValue; bluetooth::shim::GetScanning()->ScanFilterParameterSetup( bluetooth::hci::ApcfAction::ADD, 0x00, advertising_filter_parameter); } } system/main/shim/le_scanning_manager.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,7 @@ namespace shim { ::BleScannerInterface* get_ble_scanner_instance(); ::BleScannerInterface* get_ble_scanner_instance(); void init_scanning_manager(); void init_scanning_manager(); void set_ad_type_rsi_filter(bool enable); void set_ad_type_rsi_filter(bool enable); void set_empty_filter(bool enable); } // namespace shim } // namespace shim } // namespace bluetooth } // namespace bluetooth system/test/mock/mock_main_shim_le_scanning_manager.cc +4 −0 Original line number Original line Diff line number Diff line Loading @@ -42,3 +42,7 @@ void bluetooth::shim::init_scanning_manager() { void bluetooth::shim::set_ad_type_rsi_filter(bool enable) { void bluetooth::shim::set_ad_type_rsi_filter(bool enable) { mock_function_count_map[__func__]++; mock_function_count_map[__func__]++; } } void bluetooth::shim::set_empty_filter(bool enable) { mock_function_count_map[__func__]++; } Loading
system/bta/csis/csis_client.cc +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1171,7 +1171,7 @@ class CsisClientImpl : public CsisClient { void CsisActiveObserverSet(bool enable) { void CsisActiveObserverSet(bool enable) { LOG(INFO) << __func__ << " CSIS Discovery SET: " << enable; LOG(INFO) << __func__ << " CSIS Discovery SET: " << enable; bluetooth::shim::set_ad_type_rsi_filter(enable); bluetooth::shim::set_empty_filter(enable); BTA_DmBleCsisObserve( BTA_DmBleCsisObserve( enable, [](tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH* p_data) { enable, [](tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH* p_data) { /* If there's no instance we are most likely shutting /* If there's no instance we are most likely shutting Loading
system/main/shim/le_scanning_manager.cc +19 −0 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,8 @@ constexpr char kBtmLogTag[] = "SCAN"; constexpr uint16_t kAllowADTypeFilter = 0x80; constexpr uint16_t kAllowADTypeFilter = 0x80; constexpr uint8_t kFilterLogicOr = 0x00; constexpr uint8_t kFilterLogicOr = 0x00; constexpr uint8_t kLowestRssiValue = 129; constexpr uint8_t kLowestRssiValue = 129; constexpr uint16_t kAllowAllFilter = 0x00; constexpr uint16_t kListLogicOr = 0x01; class DefaultScanningCallback : public ::ScanningCallbacks { class DefaultScanningCallback : public ::ScanningCallbacks { void OnScannerRegistered(const bluetooth::Uuid app_uuid, uint8_t scanner_id, void OnScannerRegistered(const bluetooth::Uuid app_uuid, uint8_t scanner_id, Loading Loading @@ -749,3 +751,20 @@ void bluetooth::shim::set_ad_type_rsi_filter(bool enable) { bluetooth::hci::ApcfAction::ADD, 0x00, advertising_filter_parameter); bluetooth::hci::ApcfAction::ADD, 0x00, advertising_filter_parameter); } } } } void bluetooth::shim::set_empty_filter(bool enable) { bluetooth::hci::AdvertisingFilterParameter advertising_filter_parameter; bluetooth::shim::GetScanning()->ScanFilterParameterSetup( bluetooth::hci::ApcfAction::DELETE, 0x00, advertising_filter_parameter); if (enable) { /* Add an allow-all filter on index 0 */ advertising_filter_parameter.delivery_mode = bluetooth::hci::DeliveryMode::IMMEDIATE; advertising_filter_parameter.feature_selection = kAllowAllFilter; advertising_filter_parameter.list_logic_type = kListLogicOr; advertising_filter_parameter.filter_logic_type = kFilterLogicOr; advertising_filter_parameter.rssi_high_thresh = kLowestRssiValue; bluetooth::shim::GetScanning()->ScanFilterParameterSetup( bluetooth::hci::ApcfAction::ADD, 0x00, advertising_filter_parameter); } }
system/main/shim/le_scanning_manager.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,7 @@ namespace shim { ::BleScannerInterface* get_ble_scanner_instance(); ::BleScannerInterface* get_ble_scanner_instance(); void init_scanning_manager(); void init_scanning_manager(); void set_ad_type_rsi_filter(bool enable); void set_ad_type_rsi_filter(bool enable); void set_empty_filter(bool enable); } // namespace shim } // namespace shim } // namespace bluetooth } // namespace bluetooth
system/test/mock/mock_main_shim_le_scanning_manager.cc +4 −0 Original line number Original line Diff line number Diff line Loading @@ -42,3 +42,7 @@ void bluetooth::shim::init_scanning_manager() { void bluetooth::shim::set_ad_type_rsi_filter(bool enable) { void bluetooth::shim::set_ad_type_rsi_filter(bool enable) { mock_function_count_map[__func__]++; mock_function_count_map[__func__]++; } } void bluetooth::shim::set_empty_filter(bool enable) { mock_function_count_map[__func__]++; }