diff --git a/src/common/wifi/core/AccessPoint.cxx b/src/common/wifi/core/AccessPoint.cxx index 4ffefd05..3a97faf2 100644 --- a/src/common/wifi/core/AccessPoint.cxx +++ b/src/common/wifi/core/AccessPoint.cxx @@ -19,7 +19,9 @@ AccessPoint::GetInterfaceName() const noexcept std::unique_ptr AccessPoint::CreateController() { - return m_accessPointControllerFactory->Create(m_interfaceName); + return (m_accessPointControllerFactory != nullptr) + ? m_accessPointControllerFactory->Create(m_interfaceName) + : nullptr; } AccessPointFactory::AccessPointFactory(std::shared_ptr accessPointControllerFactory) : diff --git a/src/windows/server/CMakeLists.txt b/src/windows/server/CMakeLists.txt index 4e9494a6..5f2bbaa2 100644 --- a/src/windows/server/CMakeLists.txt +++ b/src/windows/server/CMakeLists.txt @@ -9,6 +9,7 @@ target_sources(${PROJECT_NAME}-server-windows target_link_libraries(${PROJECT_NAME}-server-windows PRIVATE ${PROJECT_NAME}-server + wifi-apmanager ) set_target_properties(${PROJECT_NAME}-server-windows diff --git a/src/windows/server/Main.cxx b/src/windows/server/Main.cxx index 20512f03..2c88540f 100644 --- a/src/windows/server/Main.cxx +++ b/src/windows/server/Main.cxx @@ -1,18 +1,27 @@ #include #include +#include #include #include +#include +#include using namespace Microsoft::Net::Remote; +using namespace Microsoft::Net::Wifi; int main(int argc, char* argv[]) { - const auto configuration = NetRemoteServerConfiguration::FromCommandLineArguments(argc, argv); + auto configuration = NetRemoteServerConfiguration::FromCommandLineArguments(argc, argv); + { + auto accessPointFactory = std::make_unique(nullptr); + auto accessPointManager = AccessPointManager::Create(std::move(accessPointFactory)); + configuration.AccessPointManager = accessPointManager; + } - NetRemoteServer server{ configuration.ServerAddress }; + NetRemoteServer server{ std::move(configuration) }; server.Run(); server.GetGrpcServer()->Wait();