diff options
author | bunnei <bunneidev@gmail.com> | 2022-07-16 20:30:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-16 20:30:56 +0200 |
commit | 87bb44830bb19f686d345d3640034c11037a691e (patch) | |
tree | 295f050687de9a9a4134a5087942d8d860ad0e35 /src/core/hle/service/ptm/ts.cpp | |
parent | Merge pull request #8560 from liamwhite/bitfield-may-alias (diff) | |
parent | service: nifm: Stub GetInternetConnectionStatus (diff) | |
download | yuzu-87bb44830bb19f686d345d3640034c11037a691e.tar yuzu-87bb44830bb19f686d345d3640034c11037a691e.tar.gz yuzu-87bb44830bb19f686d345d3640034c11037a691e.tar.bz2 yuzu-87bb44830bb19f686d345d3640034c11037a691e.tar.lz yuzu-87bb44830bb19f686d345d3640034c11037a691e.tar.xz yuzu-87bb44830bb19f686d345d3640034c11037a691e.tar.zst yuzu-87bb44830bb19f686d345d3640034c11037a691e.zip |
Diffstat (limited to 'src/core/hle/service/ptm/ts.cpp')
-rw-r--r-- | src/core/hle/service/ptm/ts.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/core/hle/service/ptm/ts.cpp b/src/core/hle/service/ptm/ts.cpp new file mode 100644 index 000000000..65c3f135f --- /dev/null +++ b/src/core/hle/service/ptm/ts.cpp @@ -0,0 +1,41 @@ +// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#include <memory> + +#include "core/core.h" +#include "core/hle/ipc_helpers.h" +#include "core/hle/service/ptm/ts.h" + +namespace Service::PTM { + +TS::TS(Core::System& system_) : ServiceFramework{system_, "ts"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetTemperatureRange"}, + {1, &TS::GetTemperature, "GetTemperature"}, + {2, nullptr, "SetMeasurementMode"}, + {3, nullptr, "GetTemperatureMilliC"}, + {4, nullptr, "OpenSession"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +TS::~TS() = default; + +void TS::GetTemperature(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto location{rp.PopEnum<Location>()}; + + LOG_WARNING(Service_HID, "(STUBBED) called. location={}", location); + + const s32 temperature = location == Location::Internal ? 35 : 20; + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(temperature); +} + +} // namespace Service::PTM |