summaryrefslogtreecommitdiff
path: root/src/core/hle/service/ns/system_update_control.cpp
blob: 42e7cb219a06c6be12e8e8e48705f84500b1e2af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#include "core/hle/service/cmif_serialization.h"
#include "core/hle/service/ns/system_update_control.h"
#include "system_update_control.h"

namespace Service::NS {

ISystemUpdateControl::ISystemUpdateControl(Core::System& system_)
    : ServiceFramework{system_, "ISystemUpdateControl"} {
    // clang-format off
    static const FunctionInfo functions[] = {
        {0, nullptr, "HasDownloaded"},
        {1, nullptr, "RequestCheckLatestUpdate"},
        {2, nullptr, "RequestDownloadLatestUpdate"},
        {3, nullptr, "GetDownloadProgress"},
        {4, nullptr, "ApplyDownloadedUpdate"},
        {5, nullptr, "RequestPrepareCardUpdate"},
        {6, nullptr, "GetPrepareCardUpdateProgress"},
        {7, nullptr, "HasPreparedCardUpdate"},
        {8, nullptr, "ApplyCardUpdate"},
        {9, nullptr, "GetDownloadedEulaDataSize"},
        {10, nullptr, "GetDownloadedEulaData"},
        {11, nullptr, "SetupCardUpdate"},
        {12, nullptr, "GetPreparedCardUpdateEulaDataSize"},
        {13, nullptr, "GetPreparedCardUpdateEulaData"},
        {14, nullptr, "SetupCardUpdateViaSystemUpdater"},
        {15, nullptr, "HasReceived"},
        {16, nullptr, "RequestReceiveSystemUpdate"},
        {17, nullptr, "GetReceiveProgress"},
        {18, nullptr, "ApplyReceivedUpdate"},
        {19, nullptr, "GetReceivedEulaDataSize"},
        {20, nullptr, "GetReceivedEulaData"},
        {21, &ISystemUpdateControl::SetupToReceiveSystemUpdate, "SetupToReceiveSystemUpdate"},
        {22, &ISystemUpdateControl::RequestCheckLatestUpdateIncludesRebootlessUpdate,
            "RequestCheckLatestUpdateIncludesRebootlessUpdate"},
    };
    // clang-format on

    RegisterHandlers(functions);
}

ISystemUpdateControl::~ISystemUpdateControl() = default;

void ISystemUpdateControl::SetupToReceiveSystemUpdate(HLERequestContext& ctx) {
    LOG_WARNING(Service_NS, "(STUBBED) called");
    IPC::ResponseBuilder rb{ctx, 2};
    rb.Push(ResultNs::SetupReceiveUpdateFailed);
}

void ISystemUpdateControl::RequestCheckLatestUpdateIncludesRebootlessUpdate(HLERequestContext& ctx) {
    LOG_WARNING(Service_NS, "(STUBBED) called");
    IPC::ResponseBuilder rb{ctx, 2};
    rb.Push(ResultNs::RebootlessSystemUpdateNotSupported);
}

} // namespace Service::NS