npns.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include <memory>
  5. #include "core/hle/service/npns/npns.h"
  6. #include "core/hle/service/service.h"
  7. #include "core/hle/service/sm/sm.h"
  8. namespace Service::NPNS {
  9. class NPNS_S final : public ServiceFramework<NPNS_S> {
  10. public:
  11. explicit NPNS_S(Core::System& system_) : ServiceFramework{system_, "npns:s"} {
  12. // clang-format off
  13. static const FunctionInfo functions[] = {
  14. {1, nullptr, "ListenAll"},
  15. {2, nullptr, "ListenTo"},
  16. {3, nullptr, "Receive"},
  17. {4, nullptr, "ReceiveRaw"},
  18. {5, nullptr, "GetReceiveEvent"},
  19. {6, nullptr, "ListenUndelivered"},
  20. {7, nullptr, "GetStateChangeEVent"},
  21. {11, nullptr, "SubscribeTopic"},
  22. {12, nullptr, "UnsubscribeTopic"},
  23. {13, nullptr, "QueryIsTopicExist"},
  24. {21, nullptr, "CreateToken"},
  25. {22, nullptr, "CreateTokenWithApplicationId"},
  26. {23, nullptr, "DestroyToken"},
  27. {24, nullptr, "DestroyTokenWithApplicationId"},
  28. {25, nullptr, "QueryIsTokenValid"},
  29. {26, nullptr, "ListenToMyApplicationId"},
  30. {31, nullptr, "UploadTokenToBaaS"},
  31. {32, nullptr, "DestroyTokenForBaaS"},
  32. {33, nullptr, "CreateTokenForBaaS"},
  33. {34, nullptr, "SetBaaSDeviceAccountIdList"},
  34. {101, nullptr, "Suspend"},
  35. {102, nullptr, "Resume"},
  36. {103, nullptr, "GetState"},
  37. {104, nullptr, "GetStatistics"},
  38. {105, nullptr, "GetPlayReportRequestEvent"},
  39. {111, nullptr, "GetJid"},
  40. {112, nullptr, "CreateJid"},
  41. {113, nullptr, "DestroyJid"},
  42. {114, nullptr, "AttachJid"},
  43. {115, nullptr, "DetachJid"},
  44. {120, nullptr, "CreateNotificationReceiver"},
  45. {151, nullptr, "GetStateWithHandover"},
  46. {152, nullptr, "GetStateChangeEventWithHandover"},
  47. {153, nullptr, "GetDropEventWithHandover"},
  48. {154, nullptr, "CreateTokenAsync"},
  49. {155, nullptr, "CreateTokenAsyncWithApplicationId"},
  50. {161, nullptr, "GetRequestChangeStateCancelEvent"},
  51. {162, nullptr, "RequestChangeStateForceTimedWithCancelEvent"},
  52. {201, nullptr, "RequestChangeStateForceTimed"},
  53. {202, nullptr, "RequestChangeStateForceAsync"},
  54. };
  55. // clang-format on
  56. RegisterHandlers(functions);
  57. }
  58. };
  59. class NPNS_U final : public ServiceFramework<NPNS_U> {
  60. public:
  61. explicit NPNS_U(Core::System& system_) : ServiceFramework{system_, "npns:u"} {
  62. // clang-format off
  63. static const FunctionInfo functions[] = {
  64. {1, nullptr, "ListenAll"},
  65. {2, nullptr, "ListenTo"},
  66. {3, nullptr, "Receive"},
  67. {4, nullptr, "ReceiveRaw"},
  68. {5, nullptr, "GetReceiveEvent"},
  69. {7, nullptr, "GetStateChangeEVent"},
  70. {21, nullptr, "CreateToken"},
  71. {23, nullptr, "DestroyToken"},
  72. {25, nullptr, "QueryIsTokenValid"},
  73. {26, nullptr, "ListenToMyApplicationId"},
  74. {101, nullptr, "Suspend"},
  75. {102, nullptr, "Resume"},
  76. {103, nullptr, "GetState"},
  77. {104, nullptr, "GetStatistics"},
  78. {111, nullptr, "GetJid"},
  79. {120, nullptr, "CreateNotificationReceiver"},
  80. {151, nullptr, "GetStateWithHandover"},
  81. {152, nullptr, "GetStateChangeEventWithHandover"},
  82. {153, nullptr, "GetDropEventWithHandover"},
  83. {154, nullptr, "CreateTokenAsync"},
  84. };
  85. // clang-format on
  86. RegisterHandlers(functions);
  87. }
  88. };
  89. void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
  90. std::make_shared<NPNS_S>(system)->InstallAsService(sm);
  91. std::make_shared<NPNS_U>(system)->InstallAsService(sm);
  92. }
  93. } // namespace Service::NPNS