Changes

Jump to navigation Jump to search
5,150 bytes added ,  18:26, 28 November 2019
Line 90: Line 90:  
| 102 || [[#SetSupportedNpadIdType]]
 
| 102 || [[#SetSupportedNpadIdType]]
 
|-
 
|-
| 103 || ActivateNpad
+
| 103 || [[#ActivateNpad]]
 
|-
 
|-
| 104 || DeactivateNpad
+
| 104 || [[#DeactivateNpad]]
 
|-
 
|-
 
| 106 || [[#AcquireNpadStyleSetUpdateEventHandle]]
 
| 106 || [[#AcquireNpadStyleSetUpdateEventHandle]]
Line 100: Line 100:  
| 108 || GetPlayerLedPattern
 
| 108 || GetPlayerLedPattern
 
|-
 
|-
| 109 || [5.0.0+] ActivateNpadWithRevision
+
| 109 || [5.0.0+] [[#ActivateNpadWithRevision]]
 
|-
 
|-
| 120 || SetNpadJoyHoldType
+
| 120 || [[#SetNpadJoyHoldType]]
 
|-
 
|-
| 121 || GetNpadJoyHoldType
+
| 121 || [[#GetNpadJoyHoldType]]
 
|-
 
|-
 
| 122 || [[#SetNpadJoyAssignmentModeSingleByDefault]]
 
| 122 || [[#SetNpadJoyAssignmentModeSingleByDefault]]
Line 160: Line 160:  
| 211 || [7.0.0+] [[#IsVibrationDeviceMounted]]
 
| 211 || [7.0.0+] [[#IsVibrationDeviceMounted]]
 
|-
 
|-
| 300 || [3.0.0+] ActivateConsoleSixAxisSensor
+
| 300 || [3.0.0+] [[#ActivateConsoleSixAxisSensor]]
 
|-
 
|-
 
| 301 || [3.0.0+] StartConsoleSixAxisSensor
 
| 301 || [3.0.0+] StartConsoleSixAxisSensor
Line 196: Line 196:  
| 406 || [4.0.0+] GetNpadLeftRightInterfaceType
 
| 406 || [4.0.0+] GetNpadLeftRightInterfaceType
 
|-
 
|-
| 407 || [9.0.0+]  
+
| 407 || [9.0.0+] GetNpadOfHighestBatteryLevelForJoyLeft
 
|-
 
|-
| 408 || [9.0.0+]  
+
| 408 || [9.0.0+] GetNpadOfHighestBatteryLevelForJoyRight
 
|-
 
|-
 
| 500 || [5.0.0+] GetPalmaConnectionHandle
 
| 500 || [5.0.0+] GetPalmaConnectionHandle
Line 282: Line 282:     
The input buffer contains an array of u32 [[#NpadIdType]].
 
The input buffer contains an array of u32 [[#NpadIdType]].
 +
 +
== ActivateNpad ==
 +
Takes a PID-descriptor and an [[AM_services|AppletResourceUserId]]. No output.
 +
 +
On newer sysvers this runs the same code as [[#ActivateNpadWithRevision]], with revision=0.
 +
 +
== DeactivateNpad ==
 +
Takes a PID-descriptor and an [[AM_services|AppletResourceUserId]]. No output.
 +
 +
This just returns 0.
    
== AcquireNpadStyleSetUpdateEventHandle ==
 
== AcquireNpadStyleSetUpdateEventHandle ==
Takes an input u32, an u64 [[AM_services|AppletResourceUserId]], and an u64. Returns an output event handle, autoclear for this is user-specified.
+
Takes a PID, an input u32, an u64 [[AM_services|AppletResourceUserId]], and an u64. Returns an output event handle, autoclear for this is user-specified.
    
The value for the last u64 doesn't seem to matter (?): official sw sets this to the address of the structure used for storing the event which is initialized after using this cmd.
 
The value for the last u64 doesn't seem to matter (?): official sw sets this to the address of the structure used for storing the event which is initialized after using this cmd.
 +
 +
== ActivateNpadWithRevision ==
 +
Takes a PID-descriptor, a s32 revision, and an [[AM_services|AppletResourceUserId]]. No output.
 +
 +
Revisions:
 +
* 0x0: Initial [[#ActivateNpad|revision]], pre-5.0.0.
 +
* 0x1: [5.0.0+]
 +
* 0x2: [6.0.0+]
 +
* 0x3: [8.0.0+]
 +
 +
== SetNpadJoyHoldType ==
 +
Takes a PID-descriptor, a s64, and an [[AM_services|AppletResourceUserId]]. No output.
 +
 +
== GetNpadJoyHoldType ==
 +
Takes a PID-descriptor and an [[AM_services|AppletResourceUserId]]. Returns an output s64.
    
== SetNpadJoyAssignmentModeSingleByDefault ==
 
== SetNpadJoyAssignmentModeSingleByDefault ==
Line 329: Line 354:     
== IsVibrationDeviceMounted ==
 
== IsVibrationDeviceMounted ==
Takes a total of 0x10-bytes of input and a PID, returns an output u8 bool.
+
Takes a PID, an [[#VibrationDeviceHandle]], and an u64 [[AM_services|AppletResourceUserId]], returns an output u8 bool.
 +
 
 +
== ActivateConsoleSixAxisSensor ==
 +
Takes a PID and an u64 [[AM_services|AppletResourceUserId]], no output.
    
== ActivateSevenSixAxisSensor ==
 
== ActivateSevenSixAxisSensor ==
 
Takes a PID and an u64 [[AM_services|AppletResourceUserId]], no output.
 
Takes a PID and an u64 [[AM_services|AppletResourceUserId]], no output.
 +
 +
Unused by official sw, [[#ActivateConsoleSixAxisSensor]] is used instead. However, internally ActivateSevenSixAxisSensor is identical to [[#ActivateConsoleSixAxisSensor]]. Deactivation is done with hiddbg DeactivateConsoleSixAxisSensor.
    
== StartSevenSixAxisSensor ==
 
== StartSevenSixAxisSensor ==
Line 358: Line 388:     
== GetNpadInterfaceType ==
 
== GetNpadInterfaceType ==
Takes an input u32 NpadIdType, returns an output u8 NpadInterfaceType.
+
Takes an input u32 NpadIdType, returns an output u8 [[#NpadInterfaceType]].
   −
The NpadInterfaceType must be 1 (Bluetooth), 2 (Rail), 3 (USB), or 4 (?), otherwise this will assert.
+
The NpadInterfaceType must be 1-4, otherwise this will assert.
    
== VibrationDeviceHandle ==
 
== VibrationDeviceHandle ==
Line 463: Line 493:  
== NpadIdType ==
 
== NpadIdType ==
 
This is an u32. This is the controller index used in [[HID_Shared_Memory#Controllers|sharedmem]]. 0x20 is handheld.
 
This is an u32. This is the controller index used in [[HID_Shared_Memory#Controllers|sharedmem]]. 0x20 is handheld.
 +
 +
== NpadInterfaceType ==
 +
This is the output u8 returned by [[#GetNpadInterfaceType]].
 +
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
!  Notes
 +
|-
 +
| 1 || Bluetooth ||
 +
|-
 +
| 2 || Rail ||
 +
|-
 +
| 3 || USB ||
 +
|-
 +
| 4 || Unknown ||
 +
|}
    
= hid:dbg =
 
= hid:dbg =
Line 601: Line 648:  
| 227 || [5.0.0+] GetRxPacketHistory
 
| 227 || [5.0.0+] GetRxPacketHistory
 
|-
 
|-
| 228 || [6.0.0+] AcquireOperationEventHandle
+
| 228 || [6.0.0+] [[#AcquireOperationEventHandle]]
 
|-
 
|-
 
| 229 || [6.0.0+] [[#ReadSerialFlash]]
 
| 229 || [6.0.0+] [[#ReadSerialFlash]]
 
|-
 
|-
| 230 || [6.0.0+] WriteSerialFlash
+
| 230 || [6.0.0+] [[#WriteSerialFlash]]
 
|-
 
|-
| 231 || [6.0.0+] GetOperationResult
+
| 231 || [6.0.0+] [[#GetOperationResult]]
 
|-
 
|-
 
| 232 || [6.0.0+] EnableShipmentMode
 
| 232 || [6.0.0+] EnableShipmentMode
Line 729: Line 776:     
[9.0.0+] Now takes a total of 8-bytes of input and a type-0x6 output buffer, returns a total of 8-bytes of output.
 
[9.0.0+] Now takes a total of 8-bytes of input and a type-0x6 output buffer, returns a total of 8-bytes of output.
 +
 +
== AcquireOperationEventHandle ==
 +
Takes an input u64 '''UniquePadId''', returns an output Event handle. The EventClearMode used by official sw is user-specified.
 +
 +
This is not used internally by sdk-nso besides exposing it to the user. With the sdk-nso for [9.0.0+] the wrapper funcs for this was removed (sdk-nso still has the actual cmd).
 +
 +
This must be used before [[#ReadSerialFlash]]/[[#WriteSerialFlash]]. Afterwards, this Event is used to wait for the async operation started by [[#ReadSerialFlash]]/[[#WriteSerialFlash]] to finish. After waiting on the Event, [[#GetOperationResult]] should be used.
    
== ReadSerialFlash ==
 
== ReadSerialFlash ==
Line 735: Line 789:  
Reads from the specified controller's spi-flash. The input size is the original size without page-alignment. The TransferMemory permissions is RW-.
 
Reads from the specified controller's spi-flash. The input size is the original size without page-alignment. The TransferMemory permissions is RW-.
   −
This doesn't seem to be usable?
+
See also [[#AcquireOperationEventHandle]].
   −
== GetUniquePadDeviceTypeSetInternal ==
+
With the sdk-nso for [9.0.0+] the wrapper funcs for this was removed (sdk-nso still has the actual cmd).
Takes a total of 8-bytes of input, returns a total of 4-bytes of output.
     −
[9.0.0+] Now takes a total of 8-bytes of input, returns a total of 1-byte of output.
+
== WriteSerialFlash ==
 +
Takes an input TransferMemory handle, an input u32 offset, an input u64 tmem_size, an input u64 size, and an u64 '''UniquePadId''', no output.
   −
== GetAbstractedPadHandles ==
+
Writes to the specified controller's spi-flash. The TransferMemory permissions is R--.
Takes a type-0xA output buffer containing an array of u64 '''AbstractedPadHandle''' and returns an output s32 for total entries.
+
 
 +
See also [[#AcquireOperationEventHandle]].
 +
 
 +
With the sdk-nso for [9.0.0+] the wrapper funcs for this was removed (sdk-nso still has the actual cmd).
 +
 
 +
== GetOperationResult ==
 +
Takes an input u64 '''UniquePadId''', no output.
 +
 
 +
Get the Result for the Operation and handles cleanup, for the specified controller.
 +
 
 +
This is not used internally by sdk-nso besides exposing it to the user. With the sdk-nso for [9.0.0+] the wrapper funcs for this was removed (sdk-nso still has the actual cmd).
 +
 
 +
== GetUniquePadDeviceTypeSetInternal ==
 +
Takes an input u64 '''UniquePadId''', returns an [[#DeviceTypeInternal]].
 +
 
 +
== GetAbstractedPadHandles ==
 +
Takes a type-0xA output buffer containing an array of u64 '''AbstractedPadHandle''' and returns an output s32 for total entries.
    
Returns a handle for each controller detected by the system.
 
Returns a handle for each controller detected by the system.
Line 826: Line 896:  
| 0xC || 0x4 || RGBA Single Buttons Color
 
| 0xC || 0x4 || RGBA Single Buttons Color
 
|-
 
|-
| 0x10 || 0x1 || See [[#HiddbgHdlsDeviceInfo]]::[[#GetNpadInterfaceType|NpadInterfaceType]].
+
| 0x10 || 0x1 || See [[#HiddbgHdlsDeviceInfo]]::[[#NpadInterfaceType]].
 
|-
 
|-
 
| 0x11 || 0x3 || Padding
 
| 0x11 || 0x3 || Padding
Line 953: Line 1,023:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x4 || Only one bit can be set, see below.
+
| 0x0 || 0x4 || [[#DeviceTypeInternal]]
 
|-
 
|-
 
| 0x4 || 0x4 || RGBA Single Body Color
 
| 0x4 || 0x4 || RGBA Single Body Color
Line 959: Line 1,029:  
| 0x8 || 0x4 || RGBA Single Buttons Color
 
| 0x8 || 0x4 || RGBA Single Buttons Color
 
|-
 
|-
| 0xC || 0x1 || [[#GetNpadInterfaceType|NpadInterfaceType]]. Additional type field used with the above type field, if the value doesn't match one of the following a default is used. Type Pro-Controller: value 0x3 indicates that the controller is connected via USB. Type bit21: value 0x3 = unknown. When value is 0x2, state is merged with an existing controller (when the type value is compatible with this). Otherwise, it's a dedicated controller.
+
| 0xC || 0x1 || [[#NpadInterfaceType]]. Additional type field used with the above type field, if the value doesn't match one of the following a default is used. Type Pro-Controller: value 0x3 indicates that the controller is connected via USB. Type bit21: value 0x3 = unknown. When value is 0x2, state is merged with an existing controller (when the type value is compatible with this). Otherwise, it's a dedicated controller.
 
|-
 
|-
 
| 0xD || 0x3 || Padding
 
| 0xD || 0x3 || Padding
Line 969: Line 1,039:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x1 || Type value, must match certain values (not used with the below table).
+
| 0x0 || 0x1 || [[#DeviceTypeInternal]]
 
|-
 
|-
| 0x1 || 0x1 || [[#GetNpadInterfaceType|NpadInterfaceType]]. Similar to the field from the old struct.
+
| 0x1 || 0x1 || [[#NpadInterfaceType]]. Similar to the field from the old struct.
 
|-
 
|-
 
| 0x2 || 0x2 || Padding
 
| 0x2 || 0x2 || Padding
Line 986: Line 1,056:  
This is a 0x10-byte struct. [9.0.0+] This is a 0x14-byte struct.
 
This is a 0x10-byte struct. [9.0.0+] This is a 0x14-byte struct.
   −
Bits for the above type field:
+
== DeviceTypeInternal ==
 +
This is an u32 "nn::hid::detail::DeviceTypeInternal".
 +
 
 +
[9.0.0+] This an u8 "nn::hidtypes::DeviceType".
 +
 
 +
Bits for "nn::hid::detail::DeviceTypeInternal", only 1 bit can be set:
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,034: Line 1,109:  
|}
 
|}
   −
== HdlsState ==
+
u8 values for "nn::hidtypes::DeviceType", must match one of the these values:
 +
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
!  Notes
 +
|-
 +
| 1 || JoyRight ||
 +
|-
 +
| 2 || JoyLeft ||
 
|-
 
|-
! Offset || Size || Description
+
| 3 || FullKey ||
 +
|-
 +
| 4 || JoyLeft ||  
 
|-
 
|-
| 0x0 || 0x1 || powerConnected for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
+
| 5 || JoyRight ||  
 
|-
 
|-
| 0x1 || 0x1 || ORRed with powerConnected to set the value of the first byte for the controller [[HID_Shared_Memory#Flags|flags]].
+
| 6 || FullKey ||  
 
|-
 
|-
| 0x2 || 0x6 || Unknown
+
| 7 || LarkLeft (HVC) ||  
 
|-
 
|-
| 0x8 || 0x4 || batteryCharge for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
+
| 8 || LarkRight (HVC) ||  
 
|-
 
|-
| 0xC || 0x4 || [[HID_Shared_Memory#Button_State|Buttons]]. Bit18 = HOME and bit19 = Capture.
+
| 9 || LarkLeft (NES) ||  
 
|-
 
|-
| 0x10 || 0x10(4*2*2) || Joystick data, see [[HID_Shared_Memory#Controller_State]].
+
| 10 || LarkRight (NES) ||  
 
|-
 
|-
| 0x20 || 0x1 || Unused for input. Set with output from [[#DumpHdlsStates]] (zero in some cases).
+
| 11 || Invalid ||  
 
|-
 
|-
| 0x21 || 0x3 || Padding
+
| 12 || Palma ||
|}
+
|-
 
+
| 13 || FullKey ||
This is a 0x24-byte struct.
+
|-
 
+
| 14 || Invalid ||
= hid:sys =
+
|-
This is "nn::hid::IHidSystemServer".
+
| 15 || FullKey ||
 
+
|-
{| class="wikitable" border="1"
+
| 16 || Controller is missing in sharedmem.
 +
|-
 +
| 17-18 || Invalid ||
 +
|-
 +
| 19 || [[#DeviceType]] System with [[#NpadStyleTag]] |= NpadFullKey
 +
|-
 +
| 20 || [[#DeviceType]] System with [[#NpadStyleTag]] |= NpadJoyDual
 +
|-
 +
| 21 || [[#DeviceType]] System with [[#NpadStyleTag]] |= NpadJoyDual
 +
|}
 +
 
 +
== HdlsState ==
 +
 
 +
Pre-9.0.0:
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x1 || powerConnected for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
 +
|-
 +
| 0x1 || 0x1 || ORRed with powerConnected to set the value of the first byte for the controller [[HID_Shared_Memory#Flags|flags]].
 +
|-
 +
| 0x2 || 0x6 || Unknown
 +
|-
 +
| 0x8 || 0x4 || batteryCharge for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
 +
|-
 +
| 0xC || 0x4 || [[HID_Shared_Memory#Button_State|Buttons]]. Bit18 = HOME and bit19 = Capture.
 +
|-
 +
| 0x10 || 0x10(4*2*2) || Joystick data, see [[HID_Shared_Memory#Controller_State]].
 +
|-
 +
| 0x20 || 0x1 || Unused for input. Set with output from [[#DumpHdlsStates]] (zero in some cases).
 +
|-
 +
| 0x21 || 0x3 || Padding
 +
|}
 +
 
 +
[9.0.0+]:
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || batteryCharge for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
 +
|-
 +
| 0x4 || 0x4 || Unknown
 +
|-
 +
| 0x8 || 0x8 || [[HID_Shared_Memory#Button_State|Buttons]], masked with 0xfffffffff00fffff. See above table regarding HOME/Capture buttons.
 +
|-
 +
| 0x10 || 0x10(4*2*2) || Joystick data, see [[HID_Shared_Memory#Controller_State]].
 +
|-
 +
| 0x20 || 0x1 || Unused for input. Set with output from [[#DumpHdlsStates]] (zero in some cases).
 +
|-
 +
| 0x21 || 0x3 || Padding
 +
|}
 +
 
 +
This is a 0x24-byte struct.
 +
 
 +
= hid:sys =
 +
This is "nn::hid::IHidSystemServer".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 31 || SendKeyboardLockKeyEvent
 +
|-
 +
| 101 || AcquireHomeButtonEventHandle
 +
|-
 +
| 111 || ActivateHomeButton
 +
|-
 +
| 121 || AcquireSleepButtonEventHandle
 +
|-
 +
| 131 || ActivateSleepButton
 +
|-
 +
| 141 || AcquireCaptureButtonEventHandle
 +
|-
 +
| 151 || ActivateCaptureButton
 +
|-
 +
| 161 || [7.0.0+] GetPlatformConfig
 +
|-
 +
| 210 || AcquireNfcDeviceUpdateEventHandle
 +
|-
 +
| 211 || GetNpadsWithNfc
 +
|-
 +
| 212 || AcquireNfcActivateEventHandle
 +
|-
 +
| 213 || ActivateNfc
 +
|-
 +
| 214 || [4.0.0+] GetXcdHandleForNpadWithNfc
 +
|-
 +
| 215 || [4.0.0+] IsNfcActivated
 +
|-
 +
| 230 || AcquireIrSensorEventHandle
 +
|-
 +
| 231 || ActivateIrSensor
 +
|-
 +
| 301 || ActivateNpadSystem
 +
|-
 +
| 303 || ApplyNpadSystemCommonPolicy
 
|-
 
|-
! Cmd || Name
+
| 304 || EnableAssigningSingleOnSlSrPress
 
|-
 
|-
| 31 || SendKeyboardLockKeyEvent
+
| 305 || DisableAssigningSingleOnSlSrPress
 
|-
 
|-
| 101 || AcquireHomeButtonEventHandle
+
| 306 || GetLastActiveNpad
 
|-
 
|-
| 111 || ActivateHomeButton
+
| 307 || GetNpadSystemExtStyle
 
|-
 
|-
| 121 || AcquireSleepButtonEventHandle
+
| 308 || [5.0.0+] ApplyNpadSystemCommonPolicyFull
 
|-
 
|-
| 131 || ActivateSleepButton
+
| 309 || [5.0.0+] GetNpadFullKeyGripColor
 
|-
 
|-
| 141 || AcquireCaptureButtonEventHandle
+
| 310 || [6.0.0+] [[#GetMaskedSupportedNpadStyleSet]]
 
|-
 
|-
| 151 || ActivateCaptureButton
+
| 311 || SetNpadPlayerLedBlinkingDevice
 
|-
 
|-
| 161 || [7.0.0+] GetPlatformConfig
+
| 312 || [6.0.0+] SetSupportedNpadStyleSetAll
 
|-
 
|-
| 210 || AcquireNfcDeviceUpdateEventHandle
+
| 313 || [9.0.0+] GetNpadCaptureButtonAssignment
 
|-
 
|-
| 211 || GetNpadsWithNfc
+
| 314 || [9.0.0+] GetAppletFooterUiType
|-
  −
| 212 || AcquireNfcActivateEventHandle
  −
|-
  −
| 213 || ActivateNfc
  −
|-
  −
| 214 || [4.0.0+] GetXcdHandleForNpadWithNfc
  −
|-
  −
| 215 || [4.0.0+] IsNfcActivated
  −
|-
  −
| 230 || AcquireIrSensorEventHandle
  −
|-
  −
| 231 || ActivateIrSensor
  −
|-
  −
| 301 || ActivateNpadSystem
  −
|-
  −
| 303 || ApplyNpadSystemCommonPolicy
  −
|-
  −
| 304 || EnableAssigningSingleOnSlSrPress
  −
|-
  −
| 305 || DisableAssigningSingleOnSlSrPress
  −
|-
  −
| 306 || GetLastActiveNpad
  −
|-
  −
| 307 || GetNpadSystemExtStyle
  −
|-
  −
| 308 || [5.0.0+] ApplyNpadSystemCommonPolicyFull
  −
|-
  −
| 309 || [5.0.0+] GetNpadFullKeyGripColor
  −
|-
  −
| 310 || [6.0.0+] [[#GetMaskedSupportedNpadStyleSet]]
  −
|-
  −
| 311 || SetNpadPlayerLedBlinkingDevice
  −
|-
  −
| 312 || [6.0.0+] SetSupportedNpadStyleSetAll
  −
|-
  −
| 313 || [9.0.0+] GetNpadCaptureButtonAssignment
  −
|-
  −
| 314 || [9.0.0+] GetAppletFooterUiType
   
|-
 
|-
 
| 315 || [9.0.0+] GetAppletDetailedUiType
 
| 315 || [9.0.0+] GetAppletDetailedUiType
Line 1,233: Line 1,376:  
| 830 || [7.0.0+] [[#SetNotificationLedPattern]]
 
| 830 || [7.0.0+] [[#SetNotificationLedPattern]]
 
|-
 
|-
| 831 || [9.0.0+] SetNotificationLedPatternWithTimeout
+
| 831 || [9.0.0+] [[#SetNotificationLedPatternWithTimeout]]
 
|-
 
|-
| 832 || [9.0.0+] PrepareHidsForNotificationWake
+
| 832 || [9.0.0+] [[#PrepareHidsForNotificationWake]]
 
|-
 
|-
 
| 850 || [3.0.0+] IsUsbFullKeyControllerEnabled
 
| 850 || [3.0.0+] IsUsbFullKeyControllerEnabled
Line 1,307: Line 1,450:  
| 1155 || [9.0.0+] SetForceHandheldStyleVibration
 
| 1155 || [9.0.0+] SetForceHandheldStyleVibration
 
|-
 
|-
| 1156 || [9.0.0+]  
+
| 1156 || [9.0.0+] SendConnectionTriggerWithoutTimeoutEvent
 
|}
 
|}
   Line 1,316: Line 1,459:     
== GetUniquePadsFromNpad ==
 
== GetUniquePadsFromNpad ==
Takes an input u32 [[#NpadIdType]], a type-0xA output buffer, and returns an output u64 for total output entries.
+
Takes an input u32 [[#NpadIdType]], a type-0xA output buffer, and returns an output s64 for total output entries (which is copied to a s32 by official sw).
    
The output buffer contains an array of u64 '''UniquePadId'''.
 
The output buffer contains an array of u64 '''UniquePadId'''.
Line 1,324: Line 1,467:     
== GetUniquePadIds ==
 
== GetUniquePadIds ==
Takes a type-0xA output buffer, and returns an output u64 for total output entries.
+
Takes a type-0xA output buffer, and returns an output s64 for total output entries (which is copied to a s32 by official sw).
    
The output buffer contains an array of u64 '''UniquePadId'''.
 
The output buffer contains an array of u64 '''UniquePadId'''.
Line 1,339: Line 1,482:     
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}).
 +
 +
== SetNotificationLedPatternWithTimeout ==
 +
Takes an input [[#NotificationLedPattern]], an u64 '''UniquePadId''', and an s64 TimeSpan, no output.
 +
 +
== PrepareHidsForNotificationWake ==
 +
Takes a type-0x9 input buffer containing an array of u64 '''UniquePadId''', no output.
    
== GetHidbusSystemServiceObject ==
 
== GetHidbusSystemServiceObject ==
Line 1,598: Line 1,749:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 500 ||  
+
| 500 || SetAppletResourceUserId
 
|-
 
|-
| 501 ||  
+
| 501 || RegisterAppletResourceUserId
 
|-
 
|-
| 502 ||  
+
| 502 || UnregisterAppletResourceUserId
 
|}
 
|}
   Line 1,778: Line 1,929:  
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 
|-
 
|-
| 0 || AcquireDevice || Takes an input s32, no output.
+
| 0 || [[#AcquireDevice]]
 
|-
 
|-
| 1 || ReleaseDevice || Takes an input s32, no output.
+
| 1 || [[#ReleaseDevice]]
 
|-
 
|-
| 2 || GetCtrlSession || Takes an input u32, returns an [[#ICtrlSession]].
+
| 2 || [[#GetCtrlSession]]
 
|-
 
|-
| 3 || GetReadSession || Takes an input u32, returns an [[#IReadSession]].
+
| 3 || [[#GetReadSession]]
 
|-
 
|-
| [1.0.0-2.3.0] 4 || GetWriteSession || Takes an input u32, returns an [[#IWriteSession]].
+
| 4 || [1.0.0-2.3.0] [[#GetWriteSession]]
 
|}
 
|}
 +
 +
== AcquireDevice ==
 +
Takes an input s32, no output.
 +
 +
== ReleaseDevice ==
 +
Takes an input s32, no output.
 +
 +
== GetCtrlSession ==
 +
Takes an input u32, returns an [[#ICtrlSession]].
 +
 +
== GetReadSession ==
 +
Takes an input u32, returns an [[#IReadSession]].
 +
 +
== GetWriteSession ==
 +
Takes an input u32, returns an [[#IWriteSession]].
    
== ICtrlSession ==
 
== ICtrlSession ==
Line 1,798: Line 1,964:  
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 
|-
 
|-
| 0 || GetString ||
+
| 0 || GetString
 
|-
 
|-
| 1 || GetCodeBook ||
+
| 1 || GetCodeBook
 
|-
 
|-
| 2 || GetReport ||
+
| 2 || GetReport
 
|-
 
|-
| 3 || SetReport ||
+
| 3 || SetReport
 
|-
 
|-
| 4 || GetIdle ||
+
| 4 || GetIdle
 
|-
 
|-
| 5 || SetIdle ||
+
| 5 || SetIdle
 
|-
 
|-
| 6 || GetProtocol ||
+
| 6 || GetProtocol
 
|-
 
|-
| 7 || SetProtocol ||
+
| 7 || SetProtocol
 
|-
 
|-
| 8 || GetDescriptor ||
+
| 8 || GetDescriptor
 
|-
 
|-
| 9 || SetDescriptor ||
+
| 9 || SetDescriptor
 
|-
 
|-
| 10 || GetStateChangeEvent ||
+
| 10 || GetStateChangeEvent
 
|-
 
|-
| 11 || SignalStateChangeEvent ||
+
| 11 || SignalStateChangeEvent
 
|-
 
|-
| 12 || [3.0.0+] Write ||
+
| 12 || [3.0.0+] Write
 
|}
 
|}
   −
All of these use USB [[USB_services|CtrlXfer]], except for cmd10-11 which are event(?) related, and cmd1 which copies 0x4000-bytes from state to output.
+
All of these use USB [[USB_services|CtrlXfer]], except for GetStateChangeEvent and SignalStateChangeEvent, and GetCodeBook which copies 0x4000-bytes from state to output.
    
== IReadSession ==
 
== IReadSession ==
Line 1,836: Line 2,002:  
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 
|-
 
|-
| 0 || Read ||
+
| 0 || [[#Read]]
 
|}
 
|}
   −
Cmd0 uses [[USB_services|PostBufferAsync]] etc with the INPUT endpoint. The size must be <=0x1000. The actual transfer size is returned in an output u64. The data is copied from the tmpbuf to the output buffer using the actual-transfer-size.
+
=== Read ===
 +
Uses [[USB_services|PostBufferAsync]] etc with the INPUT endpoint. The size must be <=0x1000. The actual transfer size is returned in an output u64. The data is copied from the tmpbuf to the output buffer using the actual-transfer-size.
   −
[3.0.0+] Cmd0 now takes a total of 8-bytes of input.
+
[3.0.0+] Now takes a total of 8-bytes of input.
    
== IWriteSession ==
 
== IWriteSession ==
Line 1,852: Line 2,019:  
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 
|-
 
|-
| 0 || Write || This is the inverse of [[#IReadSession]] cmd0. Uses the OUTPUT endpoint with an input buffer.
+
| 0 || [[#Write]]
 
|}
 
|}
 +
 +
=== Write ===
 +
This is the inverse of [[#IReadSession]] cmd0. Uses the OUTPUT endpoint with an input buffer.
    
= ahid:hdr =
 
= ahid:hdr =
Line 1,900: Line 2,070:  
| 5 || CheckNfcDevicePower
 
| 5 || CheckNfcDevicePower
 
|-
 
|-
| 6 || [5.0.0+]
+
| 6 || [5.0.0+] SetMcuStateImmediate
 
|-
 
|-
 
| 10 || SetNfcEvent
 
| 10 || SetNfcEvent
Line 1,966: Line 2,136:  
| 12 || DisableJoyPollingReceiveMode
 
| 12 || DisableJoyPollingReceiveMode
 
|-
 
|-
| [5.0.0-6.2.0] 13 || GetPollingData
+
| 13 || [5.0.0-6.2.0] GetPollingData
 
|-
 
|-
 
| 14 || [6.0.0+] SetStatusManagerType
 
| 14 || [6.0.0+] SetStatusManagerType

Navigation menu