2020-04-28 02:44:29 +01:00
|
|
|
|
using Ryujinx.Common.Logging;
|
|
|
|
|
using Ryujinx.HLE.HOS.Services.Ptm.Ts.Types;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Ptm.Ts
|
2019-09-19 01:45:11 +01:00
|
|
|
|
{
|
|
|
|
|
[Service("ts")]
|
|
|
|
|
class IMeasurementServer : IpcService
|
|
|
|
|
{
|
2022-07-03 09:17:24 +01:00
|
|
|
|
private const uint DefaultTemperature = 42u;
|
2020-04-28 02:44:29 +01:00
|
|
|
|
|
2019-09-19 01:45:11 +01:00
|
|
|
|
public IMeasurementServer(ServiceCtx context) { }
|
2020-04-28 02:44:29 +01:00
|
|
|
|
|
2023-04-15 00:00:34 +01:00
|
|
|
|
[CommandCmif(1)]
|
2022-07-03 09:17:24 +01:00
|
|
|
|
// GetTemperature(Location location) -> u32
|
|
|
|
|
public ResultCode GetTemperature(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
Location location = (Location)context.RequestData.ReadByte();
|
|
|
|
|
|
|
|
|
|
Logger.Stub?.PrintStub(LogClass.ServicePtm, new { location });
|
|
|
|
|
|
|
|
|
|
context.ResponseData.Write(DefaultTemperature);
|
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-15 00:00:34 +01:00
|
|
|
|
[CommandCmif(3)]
|
2020-04-28 02:44:29 +01:00
|
|
|
|
// GetTemperatureMilliC(Location location) -> u32
|
|
|
|
|
public ResultCode GetTemperatureMilliC(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
Location location = (Location)context.RequestData.ReadByte();
|
|
|
|
|
|
2020-08-04 00:32:53 +01:00
|
|
|
|
Logger.Stub?.PrintStub(LogClass.ServicePtm, new { location });
|
2020-04-28 02:44:29 +01:00
|
|
|
|
|
2022-07-03 09:17:24 +01:00
|
|
|
|
context.ResponseData.Write(DefaultTemperature * 1000);
|
2020-04-28 02:44:29 +01:00
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
2019-09-19 01:45:11 +01:00
|
|
|
|
}
|
|
|
|
|
}
|