2022-04-23 04:59:50 -04:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-10-21 17:01:01 -04:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "core/hle/service/npns/npns.h"
|
|
|
|
#include "core/hle/service/service.h"
|
|
|
|
#include "core/hle/service/sm/sm.h"
|
|
|
|
|
|
|
|
namespace Service::NPNS {
|
|
|
|
|
|
|
|
class NPNS_S final : public ServiceFramework<NPNS_S> {
|
|
|
|
public:
|
2020-11-26 15:19:08 -05:00
|
|
|
explicit NPNS_S(Core::System& system_) : ServiceFramework{system_, "npns:s"} {
|
2018-10-21 17:01:01 -04:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{1, nullptr, "ListenAll"},
|
|
|
|
{2, nullptr, "ListenTo"},
|
|
|
|
{3, nullptr, "Receive"},
|
|
|
|
{4, nullptr, "ReceiveRaw"},
|
|
|
|
{5, nullptr, "GetReceiveEvent"},
|
|
|
|
{6, nullptr, "ListenUndelivered"},
|
|
|
|
{7, nullptr, "GetStateChangeEVent"},
|
|
|
|
{11, nullptr, "SubscribeTopic"},
|
|
|
|
{12, nullptr, "UnsubscribeTopic"},
|
|
|
|
{13, nullptr, "QueryIsTopicExist"},
|
|
|
|
{21, nullptr, "CreateToken"},
|
|
|
|
{22, nullptr, "CreateTokenWithApplicationId"},
|
|
|
|
{23, nullptr, "DestroyToken"},
|
|
|
|
{24, nullptr, "DestroyTokenWithApplicationId"},
|
|
|
|
{25, nullptr, "QueryIsTokenValid"},
|
2020-06-28 22:01:34 -04:00
|
|
|
{26, nullptr, "ListenToMyApplicationId"},
|
2021-09-26 21:13:09 -04:00
|
|
|
{27, nullptr, "DestroyTokenAll"},
|
2018-10-21 17:01:01 -04:00
|
|
|
{31, nullptr, "UploadTokenToBaaS"},
|
|
|
|
{32, nullptr, "DestroyTokenForBaaS"},
|
|
|
|
{33, nullptr, "CreateTokenForBaaS"},
|
|
|
|
{34, nullptr, "SetBaaSDeviceAccountIdList"},
|
|
|
|
{101, nullptr, "Suspend"},
|
|
|
|
{102, nullptr, "Resume"},
|
|
|
|
{103, nullptr, "GetState"},
|
|
|
|
{104, nullptr, "GetStatistics"},
|
|
|
|
{105, nullptr, "GetPlayReportRequestEvent"},
|
|
|
|
{111, nullptr, "GetJid"},
|
|
|
|
{112, nullptr, "CreateJid"},
|
|
|
|
{113, nullptr, "DestroyJid"},
|
|
|
|
{114, nullptr, "AttachJid"},
|
|
|
|
{115, nullptr, "DetachJid"},
|
2019-11-12 08:54:58 -05:00
|
|
|
{120, nullptr, "CreateNotificationReceiver"},
|
|
|
|
{151, nullptr, "GetStateWithHandover"},
|
|
|
|
{152, nullptr, "GetStateChangeEventWithHandover"},
|
|
|
|
{153, nullptr, "GetDropEventWithHandover"},
|
2021-04-07 11:14:42 -04:00
|
|
|
{154, nullptr, "CreateTokenAsync"},
|
|
|
|
{155, nullptr, "CreateTokenAsyncWithApplicationId"},
|
2020-04-20 15:18:23 -04:00
|
|
|
{161, nullptr, "GetRequestChangeStateCancelEvent"},
|
|
|
|
{162, nullptr, "RequestChangeStateForceTimedWithCancelEvent"},
|
2018-10-21 17:01:01 -04:00
|
|
|
{201, nullptr, "RequestChangeStateForceTimed"},
|
2019-04-10 14:48:37 -04:00
|
|
|
{202, nullptr, "RequestChangeStateForceAsync"},
|
2018-10-21 17:01:01 -04:00
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class NPNS_U final : public ServiceFramework<NPNS_U> {
|
|
|
|
public:
|
2020-11-26 15:19:08 -05:00
|
|
|
explicit NPNS_U(Core::System& system_) : ServiceFramework{system_, "npns:u"} {
|
2018-10-21 17:01:01 -04:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{1, nullptr, "ListenAll"},
|
|
|
|
{2, nullptr, "ListenTo"},
|
|
|
|
{3, nullptr, "Receive"},
|
|
|
|
{4, nullptr, "ReceiveRaw"},
|
|
|
|
{5, nullptr, "GetReceiveEvent"},
|
|
|
|
{7, nullptr, "GetStateChangeEVent"},
|
|
|
|
{21, nullptr, "CreateToken"},
|
|
|
|
{23, nullptr, "DestroyToken"},
|
|
|
|
{25, nullptr, "QueryIsTokenValid"},
|
|
|
|
{26, nullptr, "ListenToMyApplicationId"},
|
|
|
|
{101, nullptr, "Suspend"},
|
|
|
|
{102, nullptr, "Resume"},
|
|
|
|
{103, nullptr, "GetState"},
|
|
|
|
{104, nullptr, "GetStatistics"},
|
|
|
|
{111, nullptr, "GetJid"},
|
2019-04-10 14:48:37 -04:00
|
|
|
{120, nullptr, "CreateNotificationReceiver"},
|
2019-11-12 08:54:58 -05:00
|
|
|
{151, nullptr, "GetStateWithHandover"},
|
|
|
|
{152, nullptr, "GetStateChangeEventWithHandover"},
|
|
|
|
{153, nullptr, "GetDropEventWithHandover"},
|
2021-04-07 11:14:42 -04:00
|
|
|
{154, nullptr, "CreateTokenAsync"},
|
2018-10-21 17:01:01 -04:00
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-11-26 15:19:08 -05:00
|
|
|
void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
|
|
|
|
std::make_shared<NPNS_S>(system)->InstallAsService(sm);
|
|
|
|
std::make_shared<NPNS_U>(system)->InstallAsService(sm);
|
2018-10-21 17:01:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Service::NPNS
|