diff --git a/src/core/hle/service/nwm/nwm_uds.cpp b/src/core/hle/service/nwm/nwm_uds.cpp index 380417cc25..98a2d84b81 100644 --- a/src/core/hle/service/nwm/nwm_uds.cpp +++ b/src/core/hle/service/nwm/nwm_uds.cpp @@ -1165,18 +1165,11 @@ void NWM_UDS::GetChannel(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_NWM, "called"); } -void NWM_UDS::ConnectToNetwork(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x1E, 2, 4); - - u8 connection_type = rp.Pop(); - u32 passphrase_size = rp.Pop(); - - const std::vector network_struct_buffer = rp.PopStaticBuffer(); - ASSERT(network_struct_buffer.size() == sizeof(NetworkInfo)); - - const std::vector passphrase = rp.PopStaticBuffer(); - - std::memcpy(&network_info, network_struct_buffer.data(), sizeof(network_info)); +void NWM_UDS::ConnectToNetwork(Kernel::HLERequestContext& ctx, const u8* network_info_buffer, + std::size_t network_info_size, u8 connection_type, + std::vector passphrase) { + network_info = {}; + std::memcpy(&network_info, network_info_buffer, network_info_size); // Start the connection sequence StartConnectionSequence(network_info.host_mac_address); @@ -1195,6 +1188,21 @@ void NWM_UDS::ConnectToNetwork(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); LOG_DEBUG(Service_NWM, "connection sequence finished"); }); +} + +void NWM_UDS::ConnectToNetwork(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp(ctx, 0x1E, 2, 4); + + u8 connection_type = rp.Pop(); + u32 passphrase_size = rp.Pop(); + + const std::vector network_info_buffer = rp.PopStaticBuffer(); + ASSERT(network_info_buffer.size() == sizeof(NetworkInfo)); + + std::vector passphrase = rp.PopStaticBuffer(); + + ConnectToNetwork(ctx, network_info_buffer.data(), network_info_buffer.size(), connection_type, + std::move(passphrase)); LOG_DEBUG(Service_NWM, "called"); } diff --git a/src/core/hle/service/nwm/nwm_uds.h b/src/core/hle/service/nwm/nwm_uds.h index 25898f7e42..cd02e7000a 100644 --- a/src/core/hle/service/nwm/nwm_uds.h +++ b/src/core/hle/service/nwm/nwm_uds.h @@ -404,6 +404,10 @@ private: ResultCode BeginHostingNetwork(const u8* network_info_buffer, std::size_t network_info_size, std::vector passphrase); + void ConnectToNetwork(Kernel::HLERequestContext& ctx, const u8* network_info_buffer, + std::size_t network_info_size, u8 connection_type, + std::vector passphrase); + void BeaconBroadcastCallback(u64 userdata, s64 cycles_late); /**