From 7019561fd51919ddc21fbc17220d8b2f4bc10461 Mon Sep 17 00:00:00 2001 From: Hamish Milne Date: Sun, 5 Jan 2020 16:42:04 +0000 Subject: [PATCH] Bind NWM_UDS service in the constructor --- TODO | 4 ++-- src/core/hle/service/nwm/nwm_uds.cpp | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index 9c77cec5b1..c4f46e3126 100644 --- a/TODO +++ b/TODO @@ -93,7 +93,7 @@ ✔ VM Manager @started(19-08-13 16:46) @done(20-01-04 21:09) @lasted(20w4d5h23m42s) Just need to figure out backing_mem (a u8*) ✔ Wait object @done(19-08-13 16:46) - ☐ Service @started(19-12-23 12:49) + ✔ Service @started(19-12-23 12:49) @done(20-01-05 16:41) @lasted(1w6d3h52m17s) ✔ AC @started(19-12-23 12:48) @done(19-12-24 22:38) @lasted(1d9h50m3s) ✔ ACT @done(19-12-24 23:17) ✔ AM @started(19-12-24 23:17) @done(19-12-24 23:53) @lasted(36m8s) @@ -125,7 +125,7 @@ ✔ NIM @done(19-12-31 21:08) ✔ NS @done(20-01-01 00:46) ✔ NWM @done(20-01-01 21:31) - ☐ Fix wifi_packet_received? + ✔ Fix wifi_packet_received @done(20-01-05 16:41) ✔ PM @done(20-01-01 22:14) ✔ PS @done(20-01-01 00:54) ✔ PTM @done(20-01-01 22:36) diff --git a/src/core/hle/service/nwm/nwm_uds.cpp b/src/core/hle/service/nwm/nwm_uds.cpp index 9a3de82fab..dddf55333e 100644 --- a/src/core/hle/service/nwm/nwm_uds.cpp +++ b/src/core/hle/service/nwm/nwm_uds.cpp @@ -31,7 +31,7 @@ void NWM_UDS::serialize(Archive& ar, const unsigned int) { ar& node_map; ar& connection_event; ar& received_beacons; - // TODO: Fix wifi_packet_received? + // wifi_packet_received set in constructor } SERIALIZE_IMPL(NWM_UDS) @@ -637,13 +637,6 @@ ResultVal> NWM_UDS::Initialize( recv_buffer_memory = std::move(sharedmem); ASSERT_MSG(recv_buffer_memory->GetSize() == sharedmem_size, "Invalid shared memory size."); - if (auto room_member = Network::GetRoomMember().lock()) { - wifi_packet_received = room_member->BindOnWifiPacketReceived( - [this](const Network::WifiPacket& packet) { OnWifiPacketReceived(packet); }); - } else { - LOG_ERROR(Service_NWM, "Network isn't initalized"); - } - { std::lock_guard lock(connection_status_mutex); @@ -1408,6 +1401,13 @@ NWM_UDS::NWM_UDS(Core::System& system) : ServiceFramework("nwm::UDS"), system(sy system.Kernel().GetSharedPageHandler().SetMacAddress(mac); system.Kernel().GetSharedPageHandler().SetWifiLinkLevel(SharedPage::WifiLinkLevel::BEST); + + if (auto room_member = Network::GetRoomMember().lock()) { + wifi_packet_received = room_member->BindOnWifiPacketReceived( + [this](const Network::WifiPacket& packet) { OnWifiPacketReceived(packet); }); + } else { + LOG_ERROR(Service_NWM, "Network isn't initalized"); + } } NWM_UDS::~NWM_UDS() {