aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services/Ptm/Ts/IMeasurementServer.cs
blob: 6ddc0aef2b3a09594de6a402dc49e3e238af43a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Services.Ptm.Ts.Types;

namespace Ryujinx.HLE.HOS.Services.Ptm.Ts
{
    [Service("ts")]
    class IMeasurementServer : IpcService
    {
        private const uint DefaultTemperature = 42u;

        public IMeasurementServer(ServiceCtx context) { }

        [CommandCmif(1)]
        // 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;
        }

        [CommandCmif(3)]
        // GetTemperatureMilliC(Location location) -> u32
        public ResultCode GetTemperatureMilliC(ServiceCtx context)
        {
            Location location = (Location)context.RequestData.ReadByte();

            Logger.Stub?.PrintStub(LogClass.ServicePtm, new { location });

            context.ResponseData.Write(DefaultTemperature * 1000);

            return ResultCode.Success;
        }
    }
}