[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
diff --git a/wifi/1.2/default/wifi_legacy_hal.cpp b/wifi/1.2/default/wifi_legacy_hal.cpp
index 8289c67..24b80d5 100644
--- a/wifi/1.2/default/wifi_legacy_hal.cpp
+++ b/wifi/1.2/default/wifi_legacy_hal.cpp
@@ -309,6 +309,15 @@
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 @@
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 @@
onAysncNanEventBeaconSdfPayload, onAysncNanEventDataPathRequest,
onAysncNanEventDataPathConfirm, onAysncNanEventDataPathEnd,
onAysncNanEventTransmitFollowUp, onAysncNanEventRangeRequest,
- onAysncNanEventRangeReport});
+ onAysncNanEventRangeReport, onAsyncNanEventScheduleUpdate});
}
wifi_error WifiLegacyHal::nanEnableRequest(const std::string& iface_name,
@@ -1330,6 +1341,7 @@
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
diff --git a/wifi/1.2/default/wifi_legacy_hal.h b/wifi/1.2/default/wifi_legacy_hal.h
index 193928b..05f700e 100644
--- a/wifi/1.2/default/wifi_legacy_hal.h
+++ b/wifi/1.2/default/wifi_legacy_hal.h
@@ -100,6 +100,7 @@
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
diff --git a/wifi/1.2/default/wifi_nan_iface.cpp b/wifi/1.2/default/wifi_nan_iface.cpp
index 1d786e3..e7bbfaa 100644
--- a/wifi/1.2/default/wifi_nan_iface.cpp
+++ b/wifi/1.2/default/wifi_nan_iface.cpp
@@ -467,6 +467,11 @@
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);