diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-10-20 23:23:43 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-10-21 00:01:11 +0200 |
commit | 10a2d20e26e8f43dc15be0e13c570ab28bb57242 (patch) | |
tree | 99c84b8d54b56d3edde2af7abf4aa9dce2a69fd8 /src/core/hle/service/ptm | |
parent | service: Add skeleton for psm service (diff) | |
download | yuzu-10a2d20e26e8f43dc15be0e13c570ab28bb57242.tar yuzu-10a2d20e26e8f43dc15be0e13c570ab28bb57242.tar.gz yuzu-10a2d20e26e8f43dc15be0e13c570ab28bb57242.tar.bz2 yuzu-10a2d20e26e8f43dc15be0e13c570ab28bb57242.tar.lz yuzu-10a2d20e26e8f43dc15be0e13c570ab28bb57242.tar.xz yuzu-10a2d20e26e8f43dc15be0e13c570ab28bb57242.tar.zst yuzu-10a2d20e26e8f43dc15be0e13c570ab28bb57242.zip |
Diffstat (limited to 'src/core/hle/service/ptm')
-rw-r--r-- | src/core/hle/service/ptm/psm.cpp | 12 | ||||
-rw-r--r-- | src/core/hle/service/ptm/psm.h | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp index f6186b809..a8e3813c8 100644 --- a/src/core/hle/service/ptm/psm.cpp +++ b/src/core/hle/service/ptm/psm.cpp @@ -12,10 +12,12 @@ namespace Service::PSM { +constexpr u32 BATTERY_FULLY_CHARGED = 100; // 100% Full + PSM::PSM() : ServiceFramework{"psm"} { // clang-format off static const FunctionInfo functions[] = { - {0, nullptr, "GetBatteryChargePercentage"}, + {0, &PSM::GetBatteryChargePercentage, "GetBatteryChargePercentage"}, {1, nullptr, "GetChargerType"}, {2, nullptr, "EnableBatteryCharging"}, {3, nullptr, "DisableBatteryCharging"}, @@ -41,6 +43,14 @@ PSM::PSM() : ServiceFramework{"psm"} { PSM::~PSM() = default; +void PSM::GetBatteryChargePercentage(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_PSM, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push<u32>(BATTERY_FULLY_CHARGED); +} + void InstallInterfaces(SM::ServiceManager& sm) { std::make_shared<PSM>()->InstallAsService(sm); } diff --git a/src/core/hle/service/ptm/psm.h b/src/core/hle/service/ptm/psm.h index 21955aa22..113878bb7 100644 --- a/src/core/hle/service/ptm/psm.h +++ b/src/core/hle/service/ptm/psm.h @@ -15,6 +15,9 @@ class PSM final : public ServiceFramework<PSM> { public: explicit PSM(); ~PSM() override; + +private: + void GetBatteryChargePercentage(Kernel::HLERequestContext& ctx); }; void InstallInterfaces(SM::ServiceManager& sm); |