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

Commit 1bf15f1c authored by Etan Cohen's avatar Etan Cohen
Browse files

[AWARE] Add legacy code wrapper for NDP channel indication

Integrate legacy HAL code mods to add an NDP channel indication.

Note: This CL is just the integration - not the HIDL usage of the
new API.

Bug: 37007030
Test: builds + integration tests passing
Change-Id: I59da1fb7e225a5038e436b793bc66b892786c238
parent a63de989
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -309,6 +309,15 @@ void onAysncNanEventRangeReport(NanRangeReportInd* event) {
        on_nan_event_range_report_user_callback(*event);
    }
}

std::function<void(const NanDataPathScheduleUpdateInd&)>
    on_nan_event_schedule_update_user_callback;
void onAsyncNanEventScheduleUpdate(NanDataPathScheduleUpdateInd* event) {
    const auto lock = hidl_sync_util::acquireGlobalLock();
    if (on_nan_event_schedule_update_user_callback && event) {
        on_nan_event_schedule_update_user_callback(*event);
    }
}
// End of the free-standing "C" style callbacks.

WifiLegacyHal::WifiLegacyHal()
@@ -1061,6 +1070,8 @@ wifi_error WifiLegacyHal::nanRegisterCallbackHandlers(
        user_callbacks.on_event_range_request;
    on_nan_event_range_report_user_callback =
        user_callbacks.on_event_range_report;
    on_nan_event_schedule_update_user_callback =
        user_callbacks.on_event_schedule_update;

    return global_func_table_.wifi_nan_register_handler(
        getIfaceHandle(iface_name),
@@ -1072,7 +1083,7 @@ wifi_error WifiLegacyHal::nanRegisterCallbackHandlers(
         onAysncNanEventBeaconSdfPayload, onAysncNanEventDataPathRequest,
         onAysncNanEventDataPathConfirm, onAysncNanEventDataPathEnd,
         onAysncNanEventTransmitFollowUp, onAysncNanEventRangeRequest,
         onAysncNanEventRangeReport});
         onAysncNanEventRangeReport, onAsyncNanEventScheduleUpdate});
}

wifi_error WifiLegacyHal::nanEnableRequest(const std::string& iface_name,
@@ -1330,6 +1341,7 @@ void WifiLegacyHal::invalidate() {
    on_nan_event_transmit_follow_up_user_callback = nullptr;
    on_nan_event_range_request_user_callback = nullptr;
    on_nan_event_range_report_user_callback = nullptr;
    on_nan_event_schedule_update_user_callback = nullptr;
}

}  // namespace legacy_hal
+1 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ struct NanCallbackHandlers {
        on_event_transmit_follow_up;
    std::function<void(const NanRangeRequestInd&)> on_event_range_request;
    std::function<void(const NanRangeReportInd&)> on_event_range_report;
    std::function<void(const NanDataPathScheduleUpdateInd&)> on_event_schedule_update;
};

// Full scan results contain IE info and are hence passed by reference, to
+5 −0
Original line number Diff line number Diff line
@@ -467,6 +467,11 @@ WifiNanIface::WifiNanIface(
            LOG(ERROR) << "on_event_range_report - should not be called";
        };

    callback_handlers.on_event_schedule_update =
        [weak_ptr_this](const legacy_hal::NanDataPathScheduleUpdateInd& /* msg */) {
            LOG(ERROR) << "on_event_schedule_update - should not be called";
        };

    legacy_hal::wifi_error legacy_status =
        legacy_hal_.lock()->nanRegisterCallbackHandlers(ifname_,
                                                        callback_handlers);