HID services: Difference between revisions

No edit summary
(3 intermediate revisions by the same user not shown)
Line 273: Line 273:


== SetSixAxisSensorFusionParameters ==
== SetSixAxisSensorFusionParameters ==
Takes a PID-descriptor, an u32 SixAxisSensorHandle, two floats, and an u64 [[AM_services|AppletResourceUserId]], no output.
Takes a PID-descriptor, an u32 [[#SixAxisSensorHandle]], two floats, and an u64 [[AM_services|AppletResourceUserId]], no output.


Official sw will throw an error before using this cmd, if the first float is outside of the bounds of 0.0f-1.0f.
Official sw will throw an error before using this cmd, if the first float is outside of the bounds of 0.0f-1.0f.


== GetSixAxisSensorFusionParameters ==
== GetSixAxisSensorFusionParameters ==
Takes a PID-descriptor, an u32 SixAxisSensorHandle, and an u64 [[AM_services|AppletResourceUserId]], returns two output floats.
Takes a PID-descriptor, an u32 [[#SixAxisSensorHandle]], and an u64 [[AM_services|AppletResourceUserId]], returns two output floats.


== ResetSixAxisSensorFusionParameters ==
== ResetSixAxisSensorFusionParameters ==
Takes a PID-descriptor, an u32 SixAxisSensorHandle, and an u64 [[AM_services|AppletResourceUserId]], no output.
Takes a PID-descriptor, an u32 [[#SixAxisSensorHandle]], and an u64 [[AM_services|AppletResourceUserId]], no output.


== SetGyroscopeZeroDriftMode ==
== SetGyroscopeZeroDriftMode ==
Takes a PID-descriptor, an u32 "nn::hid::SixAxisSensorHandle", an u32, and an u64 [[AM_services|AppletResourceUserId]], no output.
Takes a PID-descriptor, an u32 [[#SixAxisSensorHandle]], an u32 [[#GyroscopeZeroDriftMode]], and an u64 [[AM_services|AppletResourceUserId]], no output.
 
Official sw loads the input u32 from "nn::hid::GyroscopeZeroDriftMode".


== GetGyroscopeZeroDriftMode ==
== GetGyroscopeZeroDriftMode ==
Takes a PID-descriptor, an u32 "nn::hid::SixAxisSensorHandle", and an u64 [[AM_services|AppletResourceUserId]], returns an output u32.
Takes a PID-descriptor, an u32 [[#SixAxisSensorHandle]], and an u64 [[AM_services|AppletResourceUserId]], returns an output u32 [[#GyroscopeZeroDriftMode]].


Gets the value written by [[#SetGyroscopeZeroDriftMode]].
Gets the value written by [[#SetGyroscopeZeroDriftMode]].


== ResetGyroscopeZeroDriftMode ==
== ResetGyroscopeZeroDriftMode ==
Takes a PID-descriptor, an u32 "nn::hid::SixAxisSensorHandle", and an u64 [[AM_services|AppletResourceUserId]], no output.
Takes a PID-descriptor, an u32 [[#SixAxisSensorHandle]], and an u64 [[AM_services|AppletResourceUserId]], no output.


Same as [[#SetGyroscopeZeroDriftMode]] except the written mode is hard-coded value 1.
Same as [[#SetGyroscopeZeroDriftMode]] except the [[#GyroscopeZeroDriftMode]] is hard-coded to value 1 (Standard).


== SetSupportedNpadStyleSet ==
== SetSupportedNpadStyleSet ==
Line 417: Line 415:


The NpadInterfaceType must be 1-4, otherwise this will assert.
The NpadInterfaceType must be 1-4, otherwise this will assert.
== VibrationDeviceHandle ==
This is an u32.
== VibrationDeviceInfo ==
This is a 0x8-byte struct.
== VibrationValue ==
This is a 0x10-byte struct, which contains 4 float values.


== IAppletResource ==
== IAppletResource ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 452: Line 440:
Takes an input [[#VibrationDeviceHandle]]. No output.
Takes an input [[#VibrationDeviceHandle]]. No output.


== NpadStyleTag ==
== GyroscopeZeroDriftMode ==
This is a bitfield describing which controller styles are supported.
This is "nn::hid::GyroscopeZeroDriftMode".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Bits
Value
!  Description
!  Description
!  Notes
|-
|-
| 0
| 0 || Loose
| NpadFullKey
| Pro Controller.
|-
|-
| 1
| 1 || Standard
| NpadHandheld
| Joy-Con controller in handheld mode.
|-
|-
| 2
| 2 || Tight
| NpadJoyDual
|}
| Joy-Con controller in dual mode.
 
== SixAxisSensorHandle ==
This is an u32.
 
== VibrationDeviceHandle ==
This is an u32.
 
== VibrationDeviceInfo ==
This is a 0x8-byte struct.
 
== VibrationValue ==
This is a 0x10-byte struct, which contains 4 float values.
 
== NpadStyleTag ==
This is a bitfield describing which controller styles are supported.
 
{| class="wikitable" border="1"
!  Bits
!  Description
!  Notes
|-
|-
| 3
| 0
| NpadJoyLeft
| NpadFullKey
| Joy-Con left controller in single mode.
| Pro Controller.
|-
| 1
| NpadHandheld
| Joy-Con controller in handheld mode.
|-
| 2
| NpadJoyDual
| Joy-Con controller in dual mode.
|-
| 3
| NpadJoyLeft
| Joy-Con left controller in single mode.
|-
|-
| 4
| 4
Line 1,509: Line 1,523:
This sends subcommand 0x38 to the specified controller, for setting the pattern for the HOME button notification LED. The input structure is converted to the format used by this [https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/bluetooth_hid_subcommands_notes.md#subcommand-0x38-set-home-light subcommand].
This sends subcommand 0x38 to the specified controller, for setting the pattern for the HOME button notification LED. The input structure is converted to the format used by this [https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/bluetooth_hid_subcommands_notes.md#subcommand-0x38-set-home-light subcommand].


[9.0.0+] This runs code similar to [[#SetNotificationLedPatternWithTimeout]], except it passes the following param values to an internal func: flag=1 and TimeSpan=0 (with [[#SetNotificationLedPatternWithTimeout]] these are flag=0 and TimeSpan={input value}).
[9.0.0+] This runs code similar to [[#SetNotificationLedPatternWithTimeout]], except it passes the following param values to an internal func: flag=1 and TimeSpan=0 (with [[#SetNotificationLedPatternWithTimeout]] these are flag=0 and TimeSpan={input value}).
 
 
== SetNotificationLedPatternWithTimeout ==
== SetNotificationLedPatternWithTimeout ==
Takes an input [[#NotificationLedPattern]], an u64 '''UniquePadId''', and an s64 TimeSpan, no output.
Takes an input [[#NotificationLedPattern]], an u64 '''UniquePadId''', and an s64 TimeSpan, no output.
 
 
== PrepareHidsForNotificationWake ==
== PrepareHidsForNotificationWake ==
Takes a type-0x9 input buffer containing an array of u64 '''UniquePadId''', no output.
Takes a type-0x9 input buffer containing an array of u64 '''UniquePadId''', no output.
 
 
== GetHidbusSystemServiceObject ==
== GetHidbusSystemServiceObject ==
No input, returns an [[#IHidbusSystemServer]].
No input, returns an [[#IHidbusSystemServer]].
 
== IHidbusSystemServer ==
This is "nn::hidbus::IHidbusSystemServer".
 
This was added with [5.0.0+].
 
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 500 || SetAppletResourceUserId
|-
| 501 || RegisterAppletResourceUserId
|-
| 502 || UnregisterAppletResourceUserId
|}


== NotificationLedPattern ==
== NotificationLedPattern ==
Line 1,764: Line 1,794:
| System
| System
| Generic controller.
| Generic controller.
|}
== IHidbusSystemServer ==
This is "nn::hidbus::IHidbusSystemServer".
This was added with [5.0.0+].
{| class="wikitable" border="1"
|-
! Cmd || Name
|-
| 500 || SetAppletResourceUserId
|-
| 501 || RegisterAppletResourceUserId
|-
| 502 || UnregisterAppletResourceUserId
|}
|}