eupld.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include <memory>
  4. #include "core/hle/service/eupld/eupld.h"
  5. #include "core/hle/service/server_manager.h"
  6. #include "core/hle/service/service.h"
  7. namespace Service::EUPLD {
  8. class ErrorUploadContext final : public ServiceFramework<ErrorUploadContext> {
  9. public:
  10. explicit ErrorUploadContext(Core::System& system_) : ServiceFramework{system_, "eupld:c"} {
  11. // clang-format off
  12. static const FunctionInfo functions[] = {
  13. {0, nullptr, "SetUrl"},
  14. {1, nullptr, "ImportCrt"},
  15. {2, nullptr, "ImportPki"},
  16. {3, nullptr, "SetAutoUpload"},
  17. {4, nullptr, "GetAutoUpload"},
  18. };
  19. // clang-format on
  20. RegisterHandlers(functions);
  21. }
  22. };
  23. class ErrorUploadRequest final : public ServiceFramework<ErrorUploadRequest> {
  24. public:
  25. explicit ErrorUploadRequest(Core::System& system_) : ServiceFramework{system_, "eupld:r"} {
  26. // clang-format off
  27. static const FunctionInfo functions[] = {
  28. {0, nullptr, "Initialize"},
  29. {1, nullptr, "UploadAll"},
  30. {2, nullptr, "UploadSelected"},
  31. {3, nullptr, "GetUploadStatus"},
  32. {4, nullptr, "CancelUpload"},
  33. {5, nullptr, "GetResult"},
  34. };
  35. // clang-format on
  36. RegisterHandlers(functions);
  37. }
  38. };
  39. void LoopProcess(Core::System& system) {
  40. auto server_manager = std::make_unique<ServerManager>(system);
  41. server_manager->RegisterNamedService("eupld:c", std::make_shared<ErrorUploadContext>(system));
  42. server_manager->RegisterNamedService("eupld:r", std::make_shared<ErrorUploadRequest>(system));
  43. ServerManager::RunServer(std::move(server_manager));
  44. }
  45. } // namespace Service::EUPLD