diff options
| author | bunnei <bunneidev@gmail.com> | 2021-02-14 02:46:01 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-14 02:46:01 -0800 |
| commit | b0a39153512b1efc031f31e80924e6c14068f4a1 (patch) | |
| tree | 6662126adde3eee72afb1f1491e51841e4567f57 /src/core/hle/service/ldn/ldn.cpp | |
| parent | eae9f2e4404f6bdf8a192bc9c09e53cd87e4359d (diff) | |
| parent | d9a8060ce3eba6472a629f22bda105215dacb219 (diff) | |
Merge pull request #5920 from bunnei/am-ldn-fix
Fix LDN Initialization return code & resulting AM overflow
Diffstat (limited to 'src/core/hle/service/ldn/ldn.cpp')
| -rw-r--r-- | src/core/hle/service/ldn/ldn.cpp | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp index ee908f399..c630d93cd 100644 --- a/src/core/hle/service/ldn/ldn.cpp +++ b/src/core/hle/service/ldn/ldn.cpp @@ -6,6 +6,7 @@ #include "core/hle/ipc_helpers.h" #include "core/hle/result.h" +#include "core/hle/service/ldn/errors.h" #include "core/hle/service/ldn/ldn.h" #include "core/hle/service/sm/sm.h" @@ -103,7 +104,7 @@ public: : ServiceFramework{system_, "IUserLocalCommunicationService"} { // clang-format off static const FunctionInfo functions[] = { - {0, nullptr, "GetState"}, + {0, &IUserLocalCommunicationService::GetState, "GetState"}, {1, nullptr, "GetNetworkInfo"}, {2, nullptr, "GetIpv4Address"}, {3, nullptr, "GetDisconnectReason"}, @@ -138,13 +139,38 @@ public: RegisterHandlers(functions); } - void Initialize2(Kernel::HLERequestContext& ctx) { + void GetState(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_LDN, "(STUBBED) called"); - // Result success seem make this services start network and continue. - // If we just pass result error then it will stop and maybe try again and again. + + IPC::ResponseBuilder rb{ctx, 3}; + + // Indicate a network error, as we do not actually emulate LDN + rb.Push(static_cast<u32>(State::Error)); + + rb.Push(RESULT_SUCCESS); + } + + void Initialize2(Kernel::HLERequestContext& ctx) { + LOG_DEBUG(Service_LDN, "called"); + + is_initialized = true; + IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_UNKNOWN); + rb.Push(RESULT_SUCCESS); } + +private: + enum class State { + None, + Initialized, + AccessPointOpened, + AccessPointCreated, + StationOpened, + StationConnected, + Error, + }; + + bool is_initialized{}; }; class LDNS final : public ServiceFramework<LDNS> { |
