2018-10-17 17:15:50 +00:00
|
|
|
|
using Ryujinx.Common.Logging;
|
|
|
|
|
using Ryujinx.HLE.HOS.Ipc;
|
2018-10-07 15:12:11 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Irs
|
|
|
|
|
{
|
|
|
|
|
class IIrSensorServer : IpcService
|
|
|
|
|
{
|
2018-12-01 20:01:59 +00:00
|
|
|
|
private Dictionary<int, ServiceProcessRequest> _commands;
|
2018-10-07 15:12:11 +00:00
|
|
|
|
|
2018-12-01 20:01:59 +00:00
|
|
|
|
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
|
2018-10-07 15:12:11 +00:00
|
|
|
|
|
2018-12-01 20:01:59 +00:00
|
|
|
|
private bool _activated;
|
2018-10-07 15:12:11 +00:00
|
|
|
|
|
|
|
|
|
public IIrSensorServer()
|
|
|
|
|
{
|
2018-12-01 20:01:59 +00:00
|
|
|
|
_commands = new Dictionary<int, ServiceProcessRequest>()
|
2018-10-07 15:12:11 +00:00
|
|
|
|
{
|
|
|
|
|
{ 302, ActivateIrsensor },
|
|
|
|
|
{ 303, DeactivateIrsensor }
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ActivateIrsensor(nn::applet::AppletResourceUserId, pid)
|
2018-12-01 20:01:59 +00:00
|
|
|
|
public long ActivateIrsensor(ServiceCtx context)
|
2018-10-07 15:12:11 +00:00
|
|
|
|
{
|
2018-12-01 20:01:59 +00:00
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-10-07 15:12:11 +00:00
|
|
|
|
|
2018-12-01 20:01:59 +00:00
|
|
|
|
Logger.PrintStub(LogClass.ServiceIrs, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-10-07 15:12:11 +00:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeactivateIrsensor(nn::applet::AppletResourceUserId, pid)
|
2018-12-01 20:01:59 +00:00
|
|
|
|
public long DeactivateIrsensor(ServiceCtx context)
|
2018-10-07 15:12:11 +00:00
|
|
|
|
{
|
2018-12-01 20:01:59 +00:00
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-10-07 15:12:11 +00:00
|
|
|
|
|
2018-12-01 20:01:59 +00:00
|
|
|
|
Logger.PrintStub(LogClass.ServiceIrs, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-10-07 15:12:11 +00:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|