Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a4be4ed authored by Henri Chataing's avatar Henri Chataing
Browse files

RootCanal: Report correct Phy type in extended scan response reports

Bug: 329259305
Test: atest rootcanal_ll_test
Flag: EXEMPT, tool change
Change-Id: I2cba22644b03c3081496529ca366ac29dc60b59f
parent ca1f3cfd
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -3166,6 +3166,8 @@ void LinkLayerController::ScanIncomingLeLegacyAdvertisingPdu(
    // is connectable in the scan response report.
    scanner_.connectable_scan_response = connectable_advertising;
    scanner_.extended_scan_response = false;
    scanner_.primary_scan_response_phy = model::packets::PhyType::LE_1M;
    scanner_.secondary_scan_response_phy = model::packets::PhyType::NO_PACKETS;
    scanner_.pending_scan_request = advertising_address;
    scanner_.pending_scan_request_timeout =
        std::chrono::steady_clock::now() + kScanRequestTimeout;
@@ -3622,6 +3624,8 @@ void LinkLayerController::ScanIncomingLeExtendedAdvertisingPdu(
    // is connectable in the scan response report.
    scanner_.connectable_scan_response = connectable_advertising;
    scanner_.extended_scan_response = true;
    scanner_.primary_scan_response_phy = primary_phy;
    scanner_.secondary_scan_response_phy = secondary_phy;
    scanner_.pending_scan_request = advertising_address;

    INFO(id_,
@@ -4999,7 +5003,10 @@ void LinkLayerController::IncomingLeScanResponsePacket(
    response.scannable_ = true;
    response.legacy_ = !scanner_.extended_scan_response;
    response.scan_response_ = true;
    response.primary_phy_ = bluetooth::hci::PrimaryPhyType::LE_1M;
    response.primary_phy_ = static_cast<bluetooth::hci::PrimaryPhyType>(
        scanner_.primary_scan_response_phy);
    response.secondary_phy_ = static_cast<bluetooth::hci::SecondaryPhyType>(
        scanner_.secondary_scan_response_phy);
    // TODO: SID should be set in scan response PDU
    response.advertising_sid_ = 0xFF;
    response.tx_power_ = 0x7F;
+2 −0
Original line number Diff line number Diff line
@@ -1071,6 +1071,8 @@ class LinkLayerController {
    // Save information about the advertising PDU being scanned.
    bool connectable_scan_response;
    bool extended_scan_response;
    model::packets::PhyType primary_scan_response_phy;
    model::packets::PhyType secondary_scan_response_phy;
    std::optional<AddressWithType> pending_scan_request{};
    std::optional<std::chrono::steady_clock::time_point>
        pending_scan_request_timeout{};