npns.cpp 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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() : ServiceFramework{"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. {31, nullptr, "UploadTokenToBaaS"},
  30. {32, nullptr, "DestroyTokenForBaaS"},
  31. {33, nullptr, "CreateTokenForBaaS"},
  32. {34, nullptr, "SetBaaSDeviceAccountIdList"},
  33. {101, nullptr, "Suspend"},
  34. {102, nullptr, "Resume"},
  35. {103, nullptr, "GetState"},
  36. {104, nullptr, "GetStatistics"},
  37. {105, nullptr, "GetPlayReportRequestEvent"},
  38. {111, nullptr, "GetJid"},
  39. {112, nullptr, "CreateJid"},
  40. {113, nullptr, "DestroyJid"},
  41. {114, nullptr, "AttachJid"},
  42. {115, nullptr, "DetachJid"},
  43. {120, nullptr, "CreateNotificationReceiver"},
  44. {151, nullptr, "GetStateWithHandover"},
  45. {152, nullptr, "GetStateChangeEventWithHandover"},
  46. {153, nullptr, "GetDropEventWithHandover"},
  47. {161, nullptr, "GetRequestChangeStateCancelEvent"},
  48. {162, nullptr, "RequestChangeStateForceTimedWithCancelEvent"},
  49. {201, nullptr, "RequestChangeStateForceTimed"},
  50. {202, nullptr, "RequestChangeStateForceAsync"},
  51. };
  52. // clang-format on
  53. RegisterHandlers(functions);
  54. }
  55. };
  56. class NPNS_U final : public ServiceFramework<NPNS_U> {
  57. public:
  58. explicit NPNS_U() : ServiceFramework{"npns:u"} {
  59. // clang-format off
  60. static const FunctionInfo functions[] = {
  61. {1, nullptr, "ListenAll"},
  62. {2, nullptr, "ListenTo"},
  63. {3, nullptr, "Receive"},
  64. {4, nullptr, "ReceiveRaw"},
  65. {5, nullptr, "GetReceiveEvent"},
  66. {7, nullptr, "GetStateChangeEVent"},
  67. {21, nullptr, "CreateToken"},
  68. {23, nullptr, "DestroyToken"},
  69. {25, nullptr, "QueryIsTokenValid"},
  70. {26, nullptr, "ListenToMyApplicationId"},
  71. {101, nullptr, "Suspend"},
  72. {102, nullptr, "Resume"},
  73. {103, nullptr, "GetState"},
  74. {104, nullptr, "GetStatistics"},
  75. {111, nullptr, "GetJid"},
  76. {120, nullptr, "CreateNotificationReceiver"},
  77. {151, nullptr, "GetStateWithHandover"},
  78. {152, nullptr, "GetStateChangeEventWithHandover"},
  79. {153, nullptr, "GetDropEventWithHandover"},
  80. };
  81. // clang-format on
  82. RegisterHandlers(functions);
  83. }
  84. };
  85. void InstallInterfaces(SM::ServiceManager& sm) {
  86. std::make_shared<NPNS_S>()->InstallAsService(sm);
  87. std::make_shared<NPNS_U>()->InstallAsService(sm);
  88. }
  89. } // namespace Service::NPNS