Skip to content

Commit

Permalink
Merge pull request #358 from wheremyfoodat/helpme
Browse files Browse the repository at this point in the history
Implement AC::GetWifiStatus
  • Loading branch information
wheremyfoodat authored Dec 31, 2023
2 parents 02d506f + 46f92f1 commit 49ab77c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/services/ac.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 16 additions & 0 deletions src/core/services/ac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace ACCommands {
CloseAsync = 0x00080004,
GetLastErrorCode = 0x000A0000,
GetStatus = 0x000C0000,
GetWifiStatus = 0x000D0000,
GetConnectingInfraPriority = 0x000F0000,
RegisterDisconnectEvent = 0x00300004,
IsConnected = 0x003E0042,
Expand All @@ -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;
Expand Down Expand Up @@ -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<u32>(WifiStatus::None));
}

void ACService::isConnected(u32 messagePointer) {
log("AC::IsConnected\n");
Expand Down

0 comments on commit 49ab77c

Please sign in to comment.