summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/ldn/ldn.cpp34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp
index 1c46609ae..c630d93cd 100644
--- a/src/core/hle/service/ldn/ldn.cpp
+++ b/src/core/hle/service/ldn/ldn.cpp
@@ -104,7 +104,7 @@ public:
104 : ServiceFramework{system_, "IUserLocalCommunicationService"} { 104 : ServiceFramework{system_, "IUserLocalCommunicationService"} {
105 // clang-format off 105 // clang-format off
106 static const FunctionInfo functions[] = { 106 static const FunctionInfo functions[] = {
107 {0, nullptr, "GetState"}, 107 {0, &IUserLocalCommunicationService::GetState, "GetState"},
108 {1, nullptr, "GetNetworkInfo"}, 108 {1, nullptr, "GetNetworkInfo"},
109 {2, nullptr, "GetIpv4Address"}, 109 {2, nullptr, "GetIpv4Address"},
110 {3, nullptr, "GetDisconnectReason"}, 110 {3, nullptr, "GetDisconnectReason"},
@@ -139,14 +139,38 @@ public:
139 RegisterHandlers(functions); 139 RegisterHandlers(functions);
140 } 140 }
141 141
142 void Initialize2(Kernel::HLERequestContext& ctx) { 142 void GetState(Kernel::HLERequestContext& ctx) {
143 LOG_WARNING(Service_LDN, "(STUBBED) called"); 143 LOG_WARNING(Service_LDN, "(STUBBED) called");
144 144
145 // Return the disabled error to indicate that LDN is currently unavailable, otherwise games 145 IPC::ResponseBuilder rb{ctx, 3};
146 // will continue to try to make a connection. 146
147 // Indicate a network error, as we do not actually emulate LDN
148 rb.Push(static_cast<u32>(State::Error));
149
150 rb.Push(RESULT_SUCCESS);
151 }
152
153 void Initialize2(Kernel::HLERequestContext& ctx) {
154 LOG_DEBUG(Service_LDN, "called");
155
156 is_initialized = true;
157
147 IPC::ResponseBuilder rb{ctx, 2}; 158 IPC::ResponseBuilder rb{ctx, 2};
148 rb.Push(ERROR_DISABLED); 159 rb.Push(RESULT_SUCCESS);
149 } 160 }
161
162private:
163 enum class State {
164 None,
165 Initialized,
166 AccessPointOpened,
167 AccessPointCreated,
168 StationOpened,
169 StationConnected,
170 Error,
171 };
172
173 bool is_initialized{};
150}; 174};
151 175
152class LDNS final : public ServiceFramework<LDNS> { 176class LDNS final : public ServiceFramework<LDNS> {