module.cpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "common/logging/log.h"
  5. #include "core/hle/ipc_helpers.h"
  6. #include "core/hle/service/bcat/bcat.h"
  7. #include "core/hle/service/bcat/module.h"
  8. namespace Service::BCAT {
  9. class IBcatService final : public ServiceFramework<IBcatService> {
  10. public:
  11. IBcatService() : ServiceFramework("IBcatService") {
  12. static const FunctionInfo functions[] = {
  13. {10100, nullptr, "RequestSyncDeliveryCache"},
  14. {10101, nullptr, "RequestSyncDeliveryCacheWithDirectoryName"},
  15. {10200, nullptr, "CancelSyncDeliveryCacheRequest"},
  16. {20100, nullptr, "RequestSyncDeliveryCacheWithApplicationId"},
  17. {20101, nullptr, "RequestSyncDeliveryCacheWithApplicationIdAndDirectoryName"},
  18. {30100, nullptr, "SetPassphrase"},
  19. {30200, nullptr, "RegisterBackgroundDeliveryTask"},
  20. {30201, nullptr, "UnregisterBackgroundDeliveryTask"},
  21. {30202, nullptr, "BlockDeliveryTask"},
  22. {30203, nullptr, "UnblockDeliveryTask"},
  23. {90100, nullptr, "EnumerateBackgroundDeliveryTask"},
  24. {90200, nullptr, "GetDeliveryList"},
  25. {90201, nullptr, "ClearDeliveryCacheStorage"},
  26. {90300, nullptr, "GetPushNotificationLog"},
  27. };
  28. RegisterHandlers(functions);
  29. }
  30. };
  31. void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) {
  32. LOG_DEBUG(Service_BCAT, "called");
  33. IPC::ResponseBuilder rb{ctx, 2, 0, 1};
  34. rb.Push(RESULT_SUCCESS);
  35. rb.PushIpcInterface<IBcatService>();
  36. }
  37. Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
  38. : ServiceFramework(name), module(std::move(module)) {}
  39. Module::Interface::~Interface() = default;
  40. void InstallInterfaces(SM::ServiceManager& service_manager) {
  41. auto module = std::make_shared<Module>();
  42. std::make_shared<BCAT>(module, "bcat:a")->InstallAsService(service_manager);
  43. std::make_shared<BCAT>(module, "bcat:m")->InstallAsService(service_manager);
  44. std::make_shared<BCAT>(module, "bcat:u")->InstallAsService(service_manager);
  45. std::make_shared<BCAT>(module, "bcat:s")->InstallAsService(service_manager);
  46. }
  47. } // namespace Service::BCAT