From 46f92f145fcd87d199c45b124fce243415485d2d Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sun, 31 Dec 2023 23:36:07 +0200 Subject: [PATCH] Implement AC::GetWifiStatus --- include/services/ac.hpp | 1 + src/core/services/ac.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/services/ac.hpp b/include/services/ac.hpp index a6f686983..4ba53033f 100644 --- a/include/services/ac.hpp +++ b/include/services/ac.hpp @@ -19,6 +19,7 @@ class ACService { void getConnectingInfraPriority(u32 messagePointer); void getStatus(u32 messagePointer); void getLastErrorCode(u32 messagePointer); + void getWifiStatus(u32 messagePointer); void isConnected(u32 messagePointer); void registerDisconnectEvent(u32 messagePointer); void setClientVersion(u32 messagePointer); diff --git a/src/core/services/ac.cpp b/src/core/services/ac.cpp index 3feddebeb..8f5545fed 100644 --- a/src/core/services/ac.cpp +++ b/src/core/services/ac.cpp @@ -8,6 +8,7 @@ namespace ACCommands { CloseAsync = 0x00080004, GetLastErrorCode = 0x000A0000, GetStatus = 0x000C0000, + GetWifiStatus = 0x000D0000, GetConnectingInfraPriority = 0x000F0000, RegisterDisconnectEvent = 0x00300004, IsConnected = 0x003E0042, @@ -29,6 +30,7 @@ void ACService::handleSyncRequest(u32 messagePointer) { case ACCommands::GetConnectingInfraPriority: getConnectingInfraPriority(messagePointer); break; case ACCommands::GetLastErrorCode: getLastErrorCode(messagePointer); break; case ACCommands::GetStatus: getStatus(messagePointer); break; + case ACCommands::GetWifiStatus: getWifiStatus(messagePointer); break; case ACCommands::IsConnected: isConnected(messagePointer); break; case ACCommands::RegisterDisconnectEvent: registerDisconnectEvent(messagePointer); break; case ACCommands::SetClientVersion: setClientVersion(messagePointer); break; @@ -91,6 +93,20 @@ void ACService::getStatus(u32 messagePointer) { mem.write32(messagePointer + 8, 0); } +void ACService::getWifiStatus(u32 messagePointer) { + log("AC::GetWifiStatus (stubbed)\n"); + + enum class WifiStatus : u32 { + None = 0, + Slot1 = 1, + Slot2 = 2, + Slot3 = 4, + }; + + mem.write32(messagePointer, IPC::responseHeader(0x0D, 2, 0)); + mem.write32(messagePointer + 4, Result::Success); + mem.write32(messagePointer + 8, static_cast(WifiStatus::None)); +} void ACService::isConnected(u32 messagePointer) { log("AC::IsConnected\n");