2014-10-30 02:38:33 +01:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-17 06:38:14 +01:00
|
|
|
// Licensed under GPLv2 or any later version
|
2014-10-30 02:38:33 +01:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2016-09-20 17:21:23 +02:00
|
|
|
#include "core/hle/service/ac_u.h"
|
2015-01-21 02:16:47 +01:00
|
|
|
#include "common/logging/log.h"
|
2016-04-07 10:26:12 +02:00
|
|
|
#include "core/hle/kernel/event.h"
|
2014-10-30 02:38:33 +01:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Namespace AC_U
|
|
|
|
|
|
|
|
namespace AC_U {
|
|
|
|
|
2016-04-07 10:26:12 +02:00
|
|
|
/**
|
|
|
|
* AC_U::CloseAsync service function
|
|
|
|
* Inputs:
|
|
|
|
* 1 : Always 0x20
|
|
|
|
* 3 : Always 0
|
|
|
|
* 4 : Event handle, should be signaled when AC connection is closed
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
*/
|
|
|
|
static void CloseAsync(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
auto evt = Kernel::g_handle_table.Get<Kernel::Event>(cmd_buff[4]);
|
|
|
|
|
|
|
|
if (evt) {
|
|
|
|
evt->name = "AC_U:close_event";
|
|
|
|
evt->Signal();
|
|
|
|
}
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
|
|
|
|
|
|
|
LOG_WARNING(Service_AC, "(STUBBED) called");
|
|
|
|
}
|
2014-11-29 02:17:55 +01:00
|
|
|
/**
|
|
|
|
* AC_U::GetWifiStatus service function
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
* 2 : Output connection type, 0 = none, 1 = Old3DS Internet, 2 = New3DS Internet.
|
|
|
|
*/
|
2015-02-13 16:40:07 +01:00
|
|
|
static void GetWifiStatus(Service::Interface* self) {
|
2014-12-14 06:30:11 +01:00
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
2014-11-29 02:17:55 +01:00
|
|
|
|
|
|
|
// TODO(purpasmart96): This function is only a stub,
|
|
|
|
// it returns a valid result without implementing full functionality.
|
|
|
|
|
2016-02-28 15:12:01 +01:00
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2016-09-18 02:38:01 +02:00
|
|
|
cmd_buff[2] = 0; // Connection type set to none
|
2014-11-29 02:17:55 +01:00
|
|
|
|
2014-12-06 02:53:49 +01:00
|
|
|
LOG_WARNING(Service_AC, "(STUBBED) called");
|
2014-11-29 02:17:55 +01:00
|
|
|
}
|
|
|
|
|
2016-02-28 15:12:01 +01:00
|
|
|
/**
|
|
|
|
* AC_U::IsConnected service function
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
* 2 : bool, is connected
|
|
|
|
*/
|
|
|
|
static void IsConnected(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2016-09-18 02:38:01 +02:00
|
|
|
cmd_buff[2] = false; // Not connected to ac:u service
|
2016-02-28 15:12:01 +01:00
|
|
|
|
|
|
|
LOG_WARNING(Service_AC, "(STUBBED) called");
|
|
|
|
}
|
|
|
|
|
2014-10-30 02:38:33 +01:00
|
|
|
const Interface::FunctionInfo FunctionTable[] = {
|
2016-09-18 02:38:01 +02:00
|
|
|
{0x00010000, nullptr, "CreateDefaultConfig"},
|
|
|
|
{0x00040006, nullptr, "ConnectAsync"},
|
|
|
|
{0x00050002, nullptr, "GetConnectResult"},
|
|
|
|
{0x00080004, CloseAsync, "CloseAsync"},
|
|
|
|
{0x00090002, nullptr, "GetCloseResult"},
|
|
|
|
{0x000A0000, nullptr, "GetLastErrorCode"},
|
|
|
|
{0x000D0000, GetWifiStatus, "GetWifiStatus"},
|
|
|
|
{0x000E0042, nullptr, "GetCurrentAPInfo"},
|
|
|
|
{0x00100042, nullptr, "GetCurrentNZoneInfo"},
|
|
|
|
{0x00110042, nullptr, "GetNZoneApNumService"},
|
|
|
|
{0x00240042, nullptr, "AddDenyApType"},
|
|
|
|
{0x00270002, nullptr, "GetInfraPriority"},
|
|
|
|
{0x002D0082, nullptr, "SetRequestEulaVersion"},
|
|
|
|
{0x00300004, nullptr, "RegisterDisconnectEvent"},
|
|
|
|
{0x003C0042, nullptr, "GetAPSSIDList"},
|
|
|
|
{0x003E0042, IsConnected, "IsConnected"},
|
|
|
|
{0x00400042, nullptr, "SetClientVersion"},
|
2014-10-30 02:38:33 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Interface class
|
|
|
|
|
|
|
|
Interface::Interface() {
|
2015-01-30 19:56:49 +01:00
|
|
|
Register(FunctionTable);
|
2014-10-30 02:38:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|