INfc.cs 1015 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using Ryujinx.Common.Logging;
  2. namespace Ryujinx.HLE.HOS.Services.Nfc.NfcManager
  3. {
  4. class INfc : IpcService
  5. {
  6. private NfcPermissionLevel _permissionLevel;
  7. public INfc(NfcPermissionLevel permissionLevel)
  8. {
  9. _permissionLevel = permissionLevel;
  10. }
  11. [CommandHipc(0)]
  12. [CommandHipc(400)] // 4.0.0+
  13. // Initialize()
  14. public ResultCode Initialize(ServiceCtx context)
  15. {
  16. Logger.Stub?.PrintStub(LogClass.ServiceNfc, new { _permissionLevel });
  17. return ResultCode.Success;
  18. }
  19. [CommandHipc(3)]
  20. [CommandHipc(403)] // 4.0.0+
  21. // IsNfcEnabled() -> b8
  22. public ResultCode IsNfcEnabled(ServiceCtx context)
  23. {
  24. // NOTE: Write false value here could make nfp service not called.
  25. context.ResponseData.Write(true);
  26. Logger.Stub?.PrintStub(LogClass.ServiceNfc, new { _permissionLevel });
  27. return ResultCode.Success;
  28. }
  29. }
  30. }