mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-05 08:17:25 +00:00
0746b83edf
* Rename CommandAttribute as CommandHIpcAttribute to prepare for 12.x changes * Implement inital support for TIPC and adds SM command ids * *Ipc to *ipc * Missed a ref in last commit... * CommandAttributeTIpc to CommandAttributeTipc * Addresses comment and fixes some bugs around TIPC doesn't have any padding requirements as buffer C isn't a thing Fix for RegisterService inverting two argument only on TIPC
45 lines
No EOL
1.2 KiB
C#
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) { }
|
|
|
|
[CommandHipc(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;
|
|
}
|
|
|
|
[CommandHipc(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;
|
|
}
|
|
|
|
[CommandHipc(7)]
|
|
// OpenSession() -> IPsmSession
|
|
public ResultCode OpenSession(ServiceCtx context)
|
|
{
|
|
MakeObject(context, new IPsmSession(context.Device.System));
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
}
|
|
} |