Skip to content

Commit

Permalink
[AC] Stub undocumented functions
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Sep 24, 2023
1 parent becc777 commit ef51572
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/services/ac.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
23 changes: 23 additions & 0 deletions src/core/services/ac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace ACCommands {
CancelConnectAsync = 0x00070002,
CloseAsync = 0x00080004,
GetLastErrorCode = 0x000A0000,
GetStatus = 0x000C0000,
GetConnectingInfraPriority = 0x000F0000,
RegisterDisconnectEvent = 0x00300004,
IsConnected = 0x003E0042,
SetClientVersion = 0x00400042,
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ef51572

Please sign in to comment.