1 // Copyright 2018 yuzu emulator team
2 // Licensed under GPLv2 or any later version
3 // Refer to the license.txt file included.
4 
5 #include <memory>
6 
7 #include "core/hle/service/eupld/eupld.h"
8 #include "core/hle/service/service.h"
9 #include "core/hle/service/sm/sm.h"
10 
11 namespace Service::EUPLD {
12 
13 class ErrorUploadContext final : public ServiceFramework<ErrorUploadContext> {
14 public:
ErrorUploadContext(Core::System & system_)15     explicit ErrorUploadContext(Core::System& system_) : ServiceFramework{system_, "eupld:c"} {
16         // clang-format off
17         static const FunctionInfo functions[] = {
18             {0, nullptr, "SetUrl"},
19             {1, nullptr, "ImportCrt"},
20             {2, nullptr, "ImportPki"},
21             {3, nullptr, "SetAutoUpload"},
22             {4, nullptr, "GetAutoUpload"},
23         };
24         // clang-format on
25 
26         RegisterHandlers(functions);
27     }
28 };
29 
30 class ErrorUploadRequest final : public ServiceFramework<ErrorUploadRequest> {
31 public:
ErrorUploadRequest(Core::System & system_)32     explicit ErrorUploadRequest(Core::System& system_) : ServiceFramework{system_, "eupld:r"} {
33         // clang-format off
34         static const FunctionInfo functions[] = {
35             {0, nullptr, "Initialize"},
36             {1, nullptr, "UploadAll"},
37             {2, nullptr, "UploadSelected"},
38             {3, nullptr, "GetUploadStatus"},
39             {4, nullptr, "CancelUpload"},
40             {5, nullptr, "GetResult"},
41         };
42         // clang-format on
43 
44         RegisterHandlers(functions);
45     }
46 };
47 
InstallInterfaces(SM::ServiceManager & sm,Core::System & system)48 void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
49     std::make_shared<ErrorUploadContext>(system)->InstallAsService(sm);
50     std::make_shared<ErrorUploadRequest>(system)->InstallAsService(sm);
51 }
52 
53 } // namespace Service::EUPLD
54