diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/lbl/lbl.cpp | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp index c8415e0bf..98a79365d 100644 --- a/src/core/hle/service/lbl/lbl.cpp +++ b/src/core/hle/service/lbl/lbl.cpp @@ -5,8 +5,9 @@ #include <memory> #include "common/logging/log.h" -#include "core/hle/ipc_helpers.h" +#include "core/hle/service/ipc_helpers.h" #include "core/hle/service/lbl/lbl.h" +#include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" #include "core/hle/service/sm/sm.h" @@ -59,7 +60,7 @@ private: On = 1, }; - void SetCurrentBrightnessSetting(Kernel::HLERequestContext& ctx) { + void SetCurrentBrightnessSetting(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; auto brightness = rp.Pop<float>(); @@ -77,7 +78,7 @@ private: rb.Push(ResultSuccess); } - void GetCurrentBrightnessSetting(Kernel::HLERequestContext& ctx) { + void GetCurrentBrightnessSetting(HLERequestContext& ctx) { auto brightness = current_brightness; if (!std::isfinite(brightness)) { LOG_ERROR(Service_LBL, "Brightness is infinite!"); @@ -91,7 +92,7 @@ private: rb.Push(brightness); } - void SwitchBacklightOn(Kernel::HLERequestContext& ctx) { + void SwitchBacklightOn(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto fade_time = rp.Pop<u64_le>(); LOG_WARNING(Service_LBL, "(STUBBED) called, fade_time={}", fade_time); @@ -102,7 +103,7 @@ private: rb.Push(ResultSuccess); } - void SwitchBacklightOff(Kernel::HLERequestContext& ctx) { + void SwitchBacklightOff(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto fade_time = rp.Pop<u64_le>(); LOG_WARNING(Service_LBL, "(STUBBED) called, fade_time={}", fade_time); @@ -113,7 +114,7 @@ private: rb.Push(ResultSuccess); } - void GetBacklightSwitchStatus(Kernel::HLERequestContext& ctx) { + void GetBacklightSwitchStatus(HLERequestContext& ctx) { LOG_DEBUG(Service_LBL, "called"); IPC::ResponseBuilder rb{ctx, 3}; @@ -122,7 +123,7 @@ private: : BacklightSwitchStatus::Off); } - void EnableDimming(Kernel::HLERequestContext& ctx) { + void EnableDimming(HLERequestContext& ctx) { LOG_DEBUG(Service_LBL, "called"); dimming = true; @@ -131,7 +132,7 @@ private: rb.Push(ResultSuccess); } - void DisableDimming(Kernel::HLERequestContext& ctx) { + void DisableDimming(HLERequestContext& ctx) { LOG_DEBUG(Service_LBL, "called"); dimming = false; @@ -140,7 +141,7 @@ private: rb.Push(ResultSuccess); } - void IsDimmingEnabled(Kernel::HLERequestContext& ctx) { + void IsDimmingEnabled(HLERequestContext& ctx) { LOG_DEBUG(Service_LBL, "called"); IPC::ResponseBuilder rb{ctx, 3}; @@ -148,7 +149,7 @@ private: rb.Push(dimming); } - void EnableAutoBrightnessControl(Kernel::HLERequestContext& ctx) { + void EnableAutoBrightnessControl(HLERequestContext& ctx) { LOG_DEBUG(Service_LBL, "called"); auto_brightness = true; update_instantly = true; @@ -157,7 +158,7 @@ private: rb.Push(ResultSuccess); } - void DisableAutoBrightnessControl(Kernel::HLERequestContext& ctx) { + void DisableAutoBrightnessControl(HLERequestContext& ctx) { LOG_DEBUG(Service_LBL, "called"); auto_brightness = false; @@ -165,7 +166,7 @@ private: rb.Push(ResultSuccess); } - void IsAutoBrightnessControlEnabled(Kernel::HLERequestContext& ctx) { + void IsAutoBrightnessControlEnabled(HLERequestContext& ctx) { LOG_DEBUG(Service_LBL, "called"); IPC::ResponseBuilder rb{ctx, 3}; @@ -173,7 +174,7 @@ private: rb.Push(auto_brightness); } - void SetAmbientLightSensorValue(Kernel::HLERequestContext& ctx) { + void SetAmbientLightSensorValue(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto light_value = rp.Pop<float>(); @@ -185,7 +186,7 @@ private: rb.Push(ResultSuccess); } - void GetAmbientLightSensorValue(Kernel::HLERequestContext& ctx) { + void GetAmbientLightSensorValue(HLERequestContext& ctx) { LOG_DEBUG(Service_LBL, "called"); IPC::ResponseBuilder rb{ctx, 3}; @@ -193,7 +194,7 @@ private: rb.Push(ambient_light_value); } - void SetBrightnessReflectionDelayLevel(Kernel::HLERequestContext& ctx) { + void SetBrightnessReflectionDelayLevel(HLERequestContext& ctx) { // This is Intentional, this function does absolutely nothing LOG_DEBUG(Service_LBL, "called"); @@ -201,7 +202,7 @@ private: rb.Push(ResultSuccess); } - void GetBrightnessReflectionDelayLevel(Kernel::HLERequestContext& ctx) { + void GetBrightnessReflectionDelayLevel(HLERequestContext& ctx) { // This is intentional, the function is hard coded to return 0.0f on hardware LOG_DEBUG(Service_LBL, "called"); @@ -210,7 +211,7 @@ private: rb.Push(0.0f); } - void SetCurrentBrightnessMapping(Kernel::HLERequestContext& ctx) { + void SetCurrentBrightnessMapping(HLERequestContext& ctx) { // This is Intentional, this function does absolutely nothing LOG_DEBUG(Service_LBL, "called"); @@ -218,7 +219,7 @@ private: rb.Push(ResultSuccess); } - void GetCurrentBrightnessMapping(Kernel::HLERequestContext& ctx) { + void GetCurrentBrightnessMapping(HLERequestContext& ctx) { // This is Intentional, this function does absolutely nothing LOG_DEBUG(Service_LBL, "called"); @@ -227,7 +228,7 @@ private: // This function is suppose to return something but it seems like it doesn't } - void SetCurrentAmbientLightSensorMapping(Kernel::HLERequestContext& ctx) { + void SetCurrentAmbientLightSensorMapping(HLERequestContext& ctx) { // This is Intentional, this function does absolutely nothing LOG_DEBUG(Service_LBL, "called"); @@ -235,7 +236,7 @@ private: rb.Push(ResultSuccess); } - void GetCurrentAmbientLightSensorMapping(Kernel::HLERequestContext& ctx) { + void GetCurrentAmbientLightSensorMapping(HLERequestContext& ctx) { // This is Intentional, this function does absolutely nothing LOG_DEBUG(Service_LBL, "called"); @@ -244,7 +245,7 @@ private: // This function is suppose to return something but it seems like it doesn't } - void IsAmbientLightSensorAvailable(Kernel::HLERequestContext& ctx) { + void IsAmbientLightSensorAvailable(HLERequestContext& ctx) { LOG_WARNING(Service_LBL, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 3}; rb.Push(ResultSuccess); @@ -252,7 +253,7 @@ private: rb.Push(true); } - void SetCurrentBrightnessSettingForVrMode(Kernel::HLERequestContext& ctx) { + void SetCurrentBrightnessSettingForVrMode(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; auto brightness = rp.Pop<float>(); @@ -269,7 +270,7 @@ private: rb.Push(ResultSuccess); } - void GetCurrentBrightnessSettingForVrMode(Kernel::HLERequestContext& ctx) { + void GetCurrentBrightnessSettingForVrMode(HLERequestContext& ctx) { auto brightness = current_vr_brightness; if (!std::isfinite(brightness)) { LOG_ERROR(Service_LBL, "Brightness is infinite!"); @@ -283,7 +284,7 @@ private: rb.Push(brightness); } - void EnableVrMode(Kernel::HLERequestContext& ctx) { + void EnableVrMode(HLERequestContext& ctx) { LOG_DEBUG(Service_LBL, "called"); IPC::ResponseBuilder rb{ctx, 2}; @@ -292,7 +293,7 @@ private: vr_mode_enabled = true; } - void DisableVrMode(Kernel::HLERequestContext& ctx) { + void DisableVrMode(HLERequestContext& ctx) { LOG_DEBUG(Service_LBL, "called"); IPC::ResponseBuilder rb{ctx, 2}; @@ -301,7 +302,7 @@ private: vr_mode_enabled = false; } - void IsVrModeEnabled(Kernel::HLERequestContext& ctx) { + void IsVrModeEnabled(HLERequestContext& ctx) { LOG_DEBUG(Service_LBL, "called"); IPC::ResponseBuilder rb{ctx, 3}; @@ -319,8 +320,11 @@ private: bool auto_brightness = false; // TODO(ogniK): Move to system settings }; -void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { - std::make_shared<LBL>(system)->InstallAsService(sm); +void LoopProcess(Core::System& system) { + auto server_manager = std::make_unique<ServerManager>(system); + + server_manager->RegisterNamedService("lbl", std::make_shared<LBL>(system)); + ServerManager::RunServer(std::move(server_manager)); } } // namespace Service::LBL |