aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/service/ldn
diff options
context:
space:
mode:
authorbunnei <[email protected]>2021-02-13 21:45:09 -0800
committerbunnei <[email protected]>2021-02-13 21:45:09 -0800
commitd9a8060ce3eba6472a629f22bda105215dacb219 (patch)
tree766aed8c35ea5494ece0f160ba1907ad54ac7ef0 /src/core/hle/service/ldn
parent51c13606d6b9a25a93bd008db53a2553b16126e5 (diff)
downloadyuzu-android-d9a8060ce3eba6472a629f22bda105215dacb219.tar.gz
yuzu-android-d9a8060ce3eba6472a629f22bda105215dacb219.zip
hle: service: ldn: IUserLocalCommunicationService: Improve the stub.
Diffstat (limited to 'src/core/hle/service/ldn')
-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:
: 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"},
@@ -139,14 +139,38 @@ public:
RegisterHandlers(functions);
}
- void Initialize2(Kernel::HLERequestContext& ctx) {
+ void GetState(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_LDN, "(STUBBED) called");
- // Return the disabled error to indicate that LDN is currently unavailable, otherwise games
- // will continue to try to make a connection.
+ 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(ERROR_DISABLED);
+ rb.Push(RESULT_SUCCESS);
}
+
+private:
+ enum class State {
+ None,
+ Initialized,
+ AccessPointOpened,
+ AccessPointCreated,
+ StationOpened,
+ StationConnected,
+ Error,
+ };
+
+ bool is_initialized{};
};
class LDNS final : public ServiceFramework<LDNS> {