Loading system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc +24 −8 Original line number Diff line number Diff line Loading @@ -3301,21 +3301,37 @@ ErrorCode LinkLayerController::SetLeExtendedAdvertisingEnable( return ErrorCode::SUCCESS; } bool LinkLayerController::ConnectListBusy() { if (le_connect_) LOG_INFO("le_connect_"); if (le_scan_enable_ != bluetooth::hci::OpCode::NONE) bool LinkLayerController::ListBusy(uint16_t ignore) { if (le_connect_) { LOG_INFO("le_connect_"); if (!(ignore & DeviceProperties::kLeListIgnoreConnections)) { return true; } } if (le_scan_enable_ != bluetooth::hci::OpCode::NONE) { LOG_INFO("le_scan_enable"); for (auto advertiser : advertisers_) if (!(ignore & DeviceProperties::kLeListIgnoreScanEnable)) { return true; } } for (auto advertiser : advertisers_) { if (advertiser.IsEnabled()) { LOG_INFO("Advertising"); if (!(ignore & DeviceProperties::kLeListIgnoreAdvertising)) { return true; } return le_connect_ || le_scan_enable_ != bluetooth::hci::OpCode::NONE; } } // TODO: Add HCI_LE_Periodic_Advertising_Create_Sync return false; } bool LinkLayerController::ConnectListBusy() { return ListBusy(properties_.GetLeConnectListIgnoreReasons()); } bool LinkLayerController::ResolvingListBusy() { return ConnectListBusy(); // TODO: Add // HCI_LE_Periodic_Advertising_Create_Sync return ListBusy(properties_.GetLeResolvingListIgnoreReasons()); } ErrorCode LinkLayerController::LeConnectListRemoveDevice(Address addr, Loading system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h +2 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,8 @@ class LinkLayerController { uint16_t connection_latency, uint16_t supervision_timeout); bool ListBusy(uint16_t ignore_mask); bool ConnectListBusy(); ErrorCode LeConnectListClear(); ErrorCode LeConnectListAddDevice(Address addr, uint8_t addr_type); Loading system/vendor_libs/test_vendor_lib/model/devices/device_properties.cc +4 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,10 @@ DeviceProperties::DeviceProperties(const std::string& file_name) } } ParseHex64(root["LeSupportedFeatures"], &le_supported_features_); ParseUint16t(root["LeConnectListIgnoreReasons"], &le_connect_list_ignore_reasons_); ParseUint16t(root["LeResolvingListIgnoreReasons"], &le_resolving_list_ignore_reasons_); } } // namespace test_vendor_lib system/vendor_libs/test_vendor_lib/model/devices/device_properties.h +16 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,18 @@ class DeviceProperties { // Specification Version 4.2, Volume 2, Part E, Section 7.8.41 uint8_t GetLeResolvingListSize() const { return le_resolving_list_size_; } // Workaround for misbehaving stacks static constexpr uint8_t kLeListIgnoreScanEnable = 0x1; static constexpr uint8_t kLeListIgnoreConnections = 0x2; static constexpr uint8_t kLeListIgnoreAdvertising = 0x4; uint16_t GetLeResolvingListIgnoreReasons() const { return le_resolving_list_ignore_reasons_; } uint16_t GetLeConnectListIgnoreReasons() const { return le_connect_list_ignore_reasons_; } // Vendor-specific commands const std::vector<uint8_t>& GetLeVendorCap() const { return le_vendor_cap_; Loading Loading @@ -426,6 +438,10 @@ class DeviceProperties { std::vector<uint8_t> le_advertisement_; std::vector<uint8_t> le_scan_response_; // LE Workarounds uint16_t le_connect_list_ignore_reasons_{0}; uint16_t le_resolving_list_ignore_reasons_{0}; // ISO uint16_t iso_data_packet_length_{1021}; uint8_t num_iso_data_packets_{12}; Loading Loading
system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc +24 −8 Original line number Diff line number Diff line Loading @@ -3301,21 +3301,37 @@ ErrorCode LinkLayerController::SetLeExtendedAdvertisingEnable( return ErrorCode::SUCCESS; } bool LinkLayerController::ConnectListBusy() { if (le_connect_) LOG_INFO("le_connect_"); if (le_scan_enable_ != bluetooth::hci::OpCode::NONE) bool LinkLayerController::ListBusy(uint16_t ignore) { if (le_connect_) { LOG_INFO("le_connect_"); if (!(ignore & DeviceProperties::kLeListIgnoreConnections)) { return true; } } if (le_scan_enable_ != bluetooth::hci::OpCode::NONE) { LOG_INFO("le_scan_enable"); for (auto advertiser : advertisers_) if (!(ignore & DeviceProperties::kLeListIgnoreScanEnable)) { return true; } } for (auto advertiser : advertisers_) { if (advertiser.IsEnabled()) { LOG_INFO("Advertising"); if (!(ignore & DeviceProperties::kLeListIgnoreAdvertising)) { return true; } return le_connect_ || le_scan_enable_ != bluetooth::hci::OpCode::NONE; } } // TODO: Add HCI_LE_Periodic_Advertising_Create_Sync return false; } bool LinkLayerController::ConnectListBusy() { return ListBusy(properties_.GetLeConnectListIgnoreReasons()); } bool LinkLayerController::ResolvingListBusy() { return ConnectListBusy(); // TODO: Add // HCI_LE_Periodic_Advertising_Create_Sync return ListBusy(properties_.GetLeResolvingListIgnoreReasons()); } ErrorCode LinkLayerController::LeConnectListRemoveDevice(Address addr, Loading
system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h +2 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,8 @@ class LinkLayerController { uint16_t connection_latency, uint16_t supervision_timeout); bool ListBusy(uint16_t ignore_mask); bool ConnectListBusy(); ErrorCode LeConnectListClear(); ErrorCode LeConnectListAddDevice(Address addr, uint8_t addr_type); Loading
system/vendor_libs/test_vendor_lib/model/devices/device_properties.cc +4 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,10 @@ DeviceProperties::DeviceProperties(const std::string& file_name) } } ParseHex64(root["LeSupportedFeatures"], &le_supported_features_); ParseUint16t(root["LeConnectListIgnoreReasons"], &le_connect_list_ignore_reasons_); ParseUint16t(root["LeResolvingListIgnoreReasons"], &le_resolving_list_ignore_reasons_); } } // namespace test_vendor_lib
system/vendor_libs/test_vendor_lib/model/devices/device_properties.h +16 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,18 @@ class DeviceProperties { // Specification Version 4.2, Volume 2, Part E, Section 7.8.41 uint8_t GetLeResolvingListSize() const { return le_resolving_list_size_; } // Workaround for misbehaving stacks static constexpr uint8_t kLeListIgnoreScanEnable = 0x1; static constexpr uint8_t kLeListIgnoreConnections = 0x2; static constexpr uint8_t kLeListIgnoreAdvertising = 0x4; uint16_t GetLeResolvingListIgnoreReasons() const { return le_resolving_list_ignore_reasons_; } uint16_t GetLeConnectListIgnoreReasons() const { return le_connect_list_ignore_reasons_; } // Vendor-specific commands const std::vector<uint8_t>& GetLeVendorCap() const { return le_vendor_cap_; Loading Loading @@ -426,6 +438,10 @@ class DeviceProperties { std::vector<uint8_t> le_advertisement_; std::vector<uint8_t> le_scan_response_; // LE Workarounds uint16_t le_connect_list_ignore_reasons_{0}; uint16_t le_resolving_list_ignore_reasons_{0}; // ISO uint16_t iso_data_packet_length_{1021}; uint8_t num_iso_data_packets_{12}; Loading