service/hid: reorganize gesture-related functions

- Move SetGestureOutputRanges function registration to be with other
  gesture-related functions (next to ActivateGesture)
- Move SetGestureOutputRanges implementation to be with other
  gesture-related implementations
- Change log level from WARNING to DEBUG for SetGestureOutputRanges
- Move function declaration to private section with other IPC handlers
- Update function ordering to match service registration order

These changes improve code organization by grouping related
functionality together and maintain consistency between the
interface registration and implementation ordering.
This commit is contained in:
Zephyron 2025-02-08 19:39:53 +10:00
parent 0010882f36
commit cc48197448
No known key found for this signature in database
2 changed files with 8 additions and 9 deletions

View file

@ -89,6 +89,7 @@ IHidServer::IHidServer(Core::System& system_, std::shared_ptr<ResourceManager> r
{88, C<&IHidServer::GetSixAxisSensorIcInformation>, "GetSixAxisSensorIcInformation"},
{89, C<&IHidServer::ResetIsSixAxisSensorDeviceNewlyAssigned>, "ResetIsSixAxisSensorDeviceNewlyAssigned"},
{91, C<&IHidServer::ActivateGesture>, "ActivateGesture"},
{92, C<&IHidServer::SetGestureOutputRanges>, "SetGestureOutputRanges"},
{100, C<&IHidServer::SetSupportedNpadStyleSet>, "SetSupportedNpadStyleSet"},
{101, C<&IHidServer::GetSupportedNpadStyleSet>, "GetSupportedNpadStyleSet"},
{102, C<&IHidServer::SetSupportedNpadIdType>, "SetSupportedNpadIdType"},
@ -184,7 +185,6 @@ IHidServer::IHidServer(Core::System& system_, std::shared_ptr<ResourceManager> r
{1003, C<&IHidServer::IsFirmwareUpdateNeededForNotification>, "IsFirmwareUpdateNeededForNotification"},
{1004, C<&IHidServer::SetTouchScreenResolution>, "SetTouchScreenResolution"},
{2000, nullptr, "ActivateDigitizer"},
{92, C<&IHidServer::SetGestureOutputRanges>, "SetGestureOutputRanges"},
};
// clang-format on
@ -577,6 +577,12 @@ Result IHidServer::ActivateGesture(u32 basic_gesture_id, ClientAppletResourceUse
R_RETURN(GetResourceManager()->GetGesture()->Activate(aruid.pid, basic_gesture_id));
}
Result IHidServer::SetGestureOutputRanges(u32 param1, u32 param2, u32 param3, u32 param4) {
LOG_DEBUG(Service_HID, "SetGestureOutputRanges called with params: {}, {}, {}, {}", param1, param2, param3, param4);
// REF: https://switchbrew.org/wiki/HID_services , Undocumented. 92 [18.0.0+] SetGestureOutputRanges
R_SUCCEED();
}
Result IHidServer::SetSupportedNpadStyleSet(Core::HID::NpadStyleSet supported_style_set,
ClientAppletResourceUserId aruid) {
LOG_DEBUG(Service_HID, "called, supported_style_set={}, applet_resource_user_id={}",
@ -1437,10 +1443,4 @@ std::shared_ptr<ResourceManager> IHidServer::GetResourceManager() {
return resource_manager;
}
Result IHidServer::SetGestureOutputRanges(u32 param1, u32 param2, u32 param3, u32 param4) {
LOG_WARNING(Service_HID, "SetGestureOutputRanges called with params: {}, {}, {}, {}", param1, param2, param3, param4);
// REF: https://switchbrew.org/wiki/HID_services , Undocumented. 92 [18.0.0+] SetGestureOutputRanges
R_SUCCEED();
}
} // namespace Service::HID

View file

@ -31,8 +31,6 @@ public:
std::shared_ptr<ResourceManager> GetResourceManager();
Result SetGestureOutputRanges(u32, u32, u32, u32);
private:
Result CreateAppletResource(OutInterface<IAppletResource> out_applet_resource,
ClientAppletResourceUserId aruid);
@ -106,6 +104,7 @@ private:
Result ResetIsSixAxisSensorDeviceNewlyAssigned(Core::HID::SixAxisSensorHandle sixaxis_handle,
ClientAppletResourceUserId aruid);
Result ActivateGesture(u32 basic_gesture_id, ClientAppletResourceUserId aruid);
Result SetGestureOutputRanges(u32, u32, u32, u32);
Result SetSupportedNpadStyleSet(Core::HID::NpadStyleSet supported_style_set,
ClientAppletResourceUserId aruid);
Result GetSupportedNpadStyleSet(Out<Core::HID::NpadStyleSet> out_supported_style_set,