From ef5157219373926db0a3c7226f196df2c758342b Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sun, 24 Sep 2023 19:07:47 +0300 Subject: [PATCH] [AC] Stub undocumented functions --- include/services/ac.hpp | 2 ++ src/core/services/ac.cpp | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/services/ac.hpp b/include/services/ac.hpp index 55f46d3ed..a6f686983 100644 --- a/include/services/ac.hpp +++ b/include/services/ac.hpp @@ -16,6 +16,8 @@ class ACService { void cancelConnectAsync(u32 messagePointer); void closeAsync(u32 messagePointer); void createDefaultConfig(u32 messagePointer); + void getConnectingInfraPriority(u32 messagePointer); + void getStatus(u32 messagePointer); void getLastErrorCode(u32 messagePointer); void isConnected(u32 messagePointer); void registerDisconnectEvent(u32 messagePointer); diff --git a/src/core/services/ac.cpp b/src/core/services/ac.cpp index 25efdce62..3feddebeb 100644 --- a/src/core/services/ac.cpp +++ b/src/core/services/ac.cpp @@ -7,6 +7,8 @@ namespace ACCommands { CancelConnectAsync = 0x00070002, CloseAsync = 0x00080004, GetLastErrorCode = 0x000A0000, + GetStatus = 0x000C0000, + GetConnectingInfraPriority = 0x000F0000, RegisterDisconnectEvent = 0x00300004, IsConnected = 0x003E0042, SetClientVersion = 0x00400042, @@ -24,7 +26,9 @@ void ACService::handleSyncRequest(u32 messagePointer) { case ACCommands::CancelConnectAsync: cancelConnectAsync(messagePointer); break; case ACCommands::CloseAsync: closeAsync(messagePointer); break; case ACCommands::CreateDefaultConfig: createDefaultConfig(messagePointer); break; + case ACCommands::GetConnectingInfraPriority: getConnectingInfraPriority(messagePointer); break; case ACCommands::GetLastErrorCode: getLastErrorCode(messagePointer); break; + case ACCommands::GetStatus: getStatus(messagePointer); break; case ACCommands::IsConnected: isConnected(messagePointer); break; case ACCommands::RegisterDisconnectEvent: registerDisconnectEvent(messagePointer); break; case ACCommands::SetClientVersion: setClientVersion(messagePointer); break; @@ -69,6 +73,25 @@ void ACService::getLastErrorCode(u32 messagePointer) { mem.write32(messagePointer + 8, 0); // Hopefully this means no error? } +void ACService::getConnectingInfraPriority(u32 messagePointer) { + log("AC::GetConnectingInfraPriority (stubbed)\n"); + + // TODO: Find out what this is + mem.write32(messagePointer, IPC::responseHeader(0x0F, 2, 0)); + mem.write32(messagePointer + 4, Result::Success); + mem.write32(messagePointer + 8, 0); +} + +void ACService::getStatus(u32 messagePointer) { + log("AC::GetStatus (stubbed)\n"); + + // TODO: Find out what this is + mem.write32(messagePointer, IPC::responseHeader(0x0C, 2, 0)); + mem.write32(messagePointer + 4, Result::Success); + mem.write32(messagePointer + 8, 0); +} + + void ACService::isConnected(u32 messagePointer) { log("AC::IsConnected\n"); // This has parameters according to the command word but it's unknown what they are