0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmServer.cs
2023-04-14 20:00:34 -03:00

45 lines
No EOL
1.2 KiB
C#

using Ryujinx.Common.Logging;
namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
{
[Service("psm")]
class IPsmServer : IpcService
{
public IPsmServer(ServiceCtx context) { }
[CommandCmif(0)]
// GetBatteryChargePercentage() -> u32
public static ResultCode GetBatteryChargePercentage(ServiceCtx context)
{
int chargePercentage = 100;
context.ResponseData.Write(chargePercentage);
Logger.Stub?.PrintStub(LogClass.ServicePsm, new { chargePercentage });
return ResultCode.Success;
}
[CommandCmif(1)]
// GetChargerType() -> u32
public static ResultCode GetChargerType(ServiceCtx context)
{
ChargerType chargerType = ChargerType.ChargerOrDock;
context.ResponseData.Write((int)chargerType);
Logger.Stub?.PrintStub(LogClass.ServicePsm, new { chargerType });
return ResultCode.Success;
}
[CommandCmif(7)]
// OpenSession() -> IPsmSession
public ResultCode OpenSession(ServiceCtx context)
{
MakeObject(context, new IPsmSession(context.Device.System));
return ResultCode.Success;
}
}
}