Changes

Jump to navigation Jump to search
9,010 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 192: Line 192:  
| 404 || [4.0.0+] HasLeftRightBattery
 
| 404 || [4.0.0+] HasLeftRightBattery
 
|-
 
|-
| 405 || [4.0.0+] GetNpadInterfaceType
+
| 405 || [4.0.0+] [[#GetNpadInterfaceType]]
 
|-
 
|-
 
| 406 || [4.0.0+] GetNpadLeftRightInterfaceType
 
| 406 || [4.0.0+] GetNpadLeftRightInterfaceType
 +
|-
 +
| 407 || [9.0.0+] GetNpadOfHighestBatteryLevelForJoyLeft
 +
|-
 +
| 408 || [9.0.0+] GetNpadOfHighestBatteryLevelForJoyRight
 
|-
 
|-
 
| 500 || [5.0.0+] GetPalmaConnectionHandle
 
| 500 || [5.0.0+] GetPalmaConnectionHandle
Line 259: Line 263:  
|-
 
|-
 
| 1001 || GetNpadCommunicationMode
 
| 1001 || GetNpadCommunicationMode
 +
|-
 +
| 1002 || [9.0.0+] SetTouchScreenConfiguration
 +
|-
 +
| 1003 || [9.0.0+] IsFirmwareUpdateNeededForNotification
 
|}
 
|}
   Line 274: 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 321: 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 348: Line 386:  
== ResetSevenSixAxisSensorTimestamp ==
 
== ResetSevenSixAxisSensorTimestamp ==
 
Takes a PID and an u64 [[AM_services|AppletResourceUserId]], no output.
 
Takes a PID and an u64 [[AM_services|AppletResourceUserId]], no output.
 +
 +
== GetNpadInterfaceType ==
 +
Takes an input u32 NpadIdType, returns an output u8 [[#NpadInterfaceType]].
 +
 +
The NpadInterfaceType must be 1-4, otherwise this will assert.
    
== VibrationDeviceHandle ==
 
== VibrationDeviceHandle ==
Line 429: Line 472:  
| 9
 
| 9
 
| NpadLucia
 
| NpadLucia
| Unknown.
+
| SNES controller.
 
|-
 
|-
 
| 10-28
 
| 10-28
Line 450: 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 469: Line 529:  
|-
 
|-
 
| 12 || UnsetTouchScreenAutoPilotState
 
| 12 || UnsetTouchScreenAutoPilotState
 +
|-
 +
| 13 || [9.0.0+] GetTouchScreenConfiguration
 
|-
 
|-
 
| 20 || DeactivateMouse
 
| 20 || DeactivateMouse
Line 488: Line 550:  
| 52 || UnsetXpadAutoPilotState
 
| 52 || UnsetXpadAutoPilotState
 
|-
 
|-
| 60 || DeactivateJoyXpad
+
| 53 ([1.0.0-8.1.0] 60) || [[#DeactivateJoyXpad]]
 +
|-
 +
| 60 || [9.0.0+] ClearNpadSystemCommonPolicy
 
|-
 
|-
 
| 91 || DeactivateGesture
 
| 91 || DeactivateGesture
Line 578: Line 642:  
| 224 || [5.0.0+] [[#UpdateDesignInfo]]
 
| 224 || [5.0.0+] [[#UpdateDesignInfo]]
 
|-
 
|-
| 225 || [5.0.0+] GetUniquePadDriverState
+
| 225 || [5.0.0+] [[#GetUniquePadDriverState]]
 
|-
 
|-
| 226 || [5.0.0+] GetSixAxisSensorDriverStates
+
| 226 || [5.0.0+] [[#GetSixAxisSensorDriverStates]]
 
|-
 
|-
 
| 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 596: Line 660:  
| 233 || [6.0.0+] ClearPairingInfo
 
| 233 || [6.0.0+] ClearPairingInfo
 
|-
 
|-
| 234 || [6.0.0+] GetUniquePadDeviceTypeSetInternal
+
| 234 || [6.0.0+] [[#GetUniquePadDeviceTypeSetInternal]]
 
|-
 
|-
 
| 235 || [7.0.0+] EnableAnalogStickPower
 
| 235 || [7.0.0+] EnableAnalogStickPower
 
|-
 
|-
| 301 || [5.0.0+] [[#GetAbstractedPadHandles]]
+
| 236 || [9.0.0+] RequestKuinaUartClockCal
 +
|-
 +
| 237 || [9.0.0+] GetKuinaUartClockCal
 +
|-
 +
| 238 || [9.0.0+] SetKuinaUartClockTrim
 +
|-
 +
| 239 || [9.0.0+] KuinaLoopbackTest
 +
|-
 +
| 240 || [9.0.0+] RequestBatteryVoltage
 +
|-
 +
| 241 || [9.0.0+] GetBatteryVoltage
 
|-
 
|-
| 302 || [5.0.0+] [[#GetAbstractedPadState]]
+
| 242 || [9.0.0+] GetUniquePadPowerInfo
 
|-
 
|-
| 303 || [5.0.0+] [[#GetAbstractedPadsState]]
+
| 243 || [9.0.0+] RebootUniquePad
 
|-
 
|-
| 321 || [5.0.0+] [[#SetAutoPilotVirtualPadState]]
+
| 244 || [9.0.0+] RequestKuinaFirmwareVersion
 
|-
 
|-
| 322 || [5.0.0+] [[#UnsetAutoPilotVirtualPadState]]
+
| 245 || [9.0.0+] GetKuinaFirmwareVersion
 +
|-
 +
| 246 || [9.0.0+] GetVidPid
 +
|-
 +
| 301 || [5.0.0-8.1.0] [[#GetAbstractedPadHandles]]
 +
|-
 +
| 302 || [5.0.0-8.1.0] [[#GetAbstractedPadState]]
 +
|-
 +
| 303 || [5.0.0-8.1.0] [[#GetAbstractedPadsState]]
 +
|-
 +
| 321 || [5.0.0-8.1.0] [[#SetAutoPilotVirtualPadState]]
 +
|-
 +
| 322 || [5.0.0-8.1.0] [[#UnsetAutoPilotVirtualPadState]]
 
|-
 
|-
 
| 323 || [5.0.0+] [[#UnsetAllAutoPilotVirtualPadState]]
 
| 323 || [5.0.0+] [[#UnsetAllAutoPilotVirtualPadState]]
Line 639: Line 725:  
|-
 
|-
 
| 501 || [8.0.0+] IsFactoryBootEnabled
 
| 501 || [8.0.0+] IsFactoryBootEnabled
 +
|-
 +
| 550 || [9.0.0+] SetAnalogStickModelDataTemporarily
 +
|-
 +
| 551 || [9.0.0+] GetAnalogStickModelData
 +
|-
 +
| 552 || [9.0.0+] ResetAnalogStickModelData
 
|}
 
|}
   Line 674: Line 766:     
Sends the spi-write subcommand to the specified controller, for writing to offset 0x6050 size 0xD. The first 3-bytes from each u32 is used for the spi-write-data, with the u8 being copied immediately afterwards the color data.
 
Sends the spi-write subcommand to the specified controller, for writing to offset 0x6050 size 0xD. The first 3-bytes from each u32 is used for the spi-write-data, with the u8 being copied immediately afterwards the color data.
 +
 +
== GetUniquePadDriverState ==
 +
Takes a total of 8-bytes of input, returns a total of 0x20-bytes of output.
 +
 +
[9.0.0+] Now takes a total of 8-bytes of input, returns a total of 0x18-bytes of output.
 +
 +
== GetSixAxisSensorDriverStates ==
 +
Takes a total of 8-bytes of input and a type-0xA 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 680: 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]].
 +
 
 +
With the sdk-nso for [9.0.0+] the wrapper funcs for this was removed (sdk-nso still has the actual cmd).
   −
== GetAbstractedPadHandles ==
+
== WriteSerialFlash ==
Takes a type-0xA output buffer containing an array of u64 '''AbstractedPadHandle''' and returns an output s32 for total entries.
+
Takes an input TransferMemory handle, an input u32 offset, an input u64 tmem_size, an input u64 size, and an u64 '''UniquePadId''', no output.
   −
Returns a handle for each controller detected by the system.
+
Writes to the specified controller's spi-flash. The TransferMemory permissions is R--.
   −
== GetAbstractedPadState ==
+
See also [[#AcquireOperationEventHandle]].
Takes an input u64 '''AbstractedPadHandle''', returns an output [[#AbstractedPadState]].
+
 
 +
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.
 +
 
 +
== GetAbstractedPadState ==
 +
Takes an input u64 '''AbstractedPadHandle''', returns an output [[#AbstractedPadState]].
    
== GetAbstractedPadsState ==
 
== GetAbstractedPadsState ==
Line 748: Line 878:  
== SetHdlsState ==
 
== SetHdlsState ==
 
Takes an input [[#HdlsState]] and an input 8-byte '''HdlsHandle''', no output.
 
Takes an input [[#HdlsState]] and an input 8-byte '''HdlsHandle''', no output.
 +
 +
[9.0.0+] Input order was swapped: now takes an input 8-byte '''HdlsHandle''' and a [[#HdlsState]], no output.
    
== AbstractedPadState ==
 
== AbstractedPadState ==
Line 764: Line 896:  
| 0xC || 0x4 || RGBA Single Buttons Color
 
| 0xC || 0x4 || RGBA Single Buttons Color
 
|-
 
|-
| 0x10 || 0x1 || Type2. See [[#HiddbgHdlsDeviceInfo]]::type2.
+
| 0x10 || 0x1 || See [[#HiddbgHdlsDeviceInfo]]::[[#NpadInterfaceType]].
 
|-
 
|-
 
| 0x11 || 0x3 || Padding
 
| 0x11 || 0x3 || Padding
Line 863: Line 995:  
| 0x4 || 0x4 || Padding
 
| 0x4 || 0x4 || Padding
 
|-
 
|-
| 0x8 || 0x400(0x40*0x10) || Array of [[#HdlsStateListEntry]].
+
| 0x8 || <[[#HdlsStateListEntry]] size>*0x10 || Array of [[#HdlsStateListEntry]].
 
|}
 
|}
   −
This is a 0x408-byte struct.
+
This is a 0x408-byte struct. [9.0.0+] This is a 0x488-byte struct.
    
This contains a list of all controllers, including non-virtual controllers.
 
This contains a list of all controllers, including non-virtual controllers.
Line 877: Line 1,009:  
| 0x0 || 0x8 || HdlsHandle
 
| 0x0 || 0x8 || HdlsHandle
 
|-
 
|-
| 0x8 || 0x10 || [[#HdlsDeviceInfo]]. With [[#ApplyHdlsStateList]] this is only used when creating new devices.
+
| 0x8 || [[#HdlsDeviceInfo]] size || [[#HdlsDeviceInfo]]. With [[#ApplyHdlsStateList]] this is only used when creating new devices.
 
|-
 
|-
| 0x18 || 0x24 || [[#HdlsState]]
+
| 0x8 + [[#HdlsDeviceInfo]] size, with 8-byte alignment || 0x24 || [[#HdlsState]]
 
|-
 
|-
| 0x3C || 0x4 || Padding
+
| <Immediately following the above> || 0x4 || Padding
 
|}
 
|}
   −
This is a 0x40-byte struct.
+
This is a 0x40-byte struct. [9.0.0+] This is a 0x48-byte struct.
    
== HdlsDeviceInfo ==
 
== HdlsDeviceInfo ==
Line 891: 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 897: Line 1,029:  
| 0x8 || 0x4 || RGBA Single Buttons Color
 
| 0x8 || 0x4 || RGBA Single Buttons Color
 
|-
 
|-
| 0xC || 0x1 || 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
 
|}
 
|}
   −
This is a 0x10-byte struct.
+
[9.0.0+]:
 
  −
Bits for the above type field:
  −
 
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Bits
  −
!  Description
  −
!  Notes
   
|-
 
|-
| 0-7
+
! Offset || Size || Description
|  
+
|-
| BIT(N*4+0) = Pro Controller, BIT(N*4+1) = Joy-Con Left, BIT(N*4+2) = Joy-Con Right, BIT(N*4+3) = invalid. Where N is 0-1.
+
| 0x0 || 0x1 || [[#DeviceTypeInternal]]
 
|-
 
|-
| 8-10
+
| 0x1 || 0x1 || [[#NpadInterfaceType]]. Similar to the field from the old struct.
|  
  −
| Pro Controller
   
|-
 
|-
| 11
+
| 0x2 || 0x2 || Padding
 +
|-
 +
| 0x4 || 0x4 || RGBA Single Body Color
 +
|-
 +
| 0x8 || 0x4 || RGBA Single Buttons Color
 +
|-
 +
| 0xC || 0x4 || RGBA Unknown Body Color
 +
|-
 +
| 0x10 || 0x4 || RGBA Unknown Buttons Color
 +
|}
 +
 
 +
This is a 0x10-byte struct. [9.0.0+] This is a 0x14-byte struct.
 +
 
 +
== 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"
 +
!  Bits
 +
!  Description
 +
!  Notes
 +
|-
 +
| 0-7
 +
|
 +
| BIT(N*4+0) = Pro Controller, BIT(N*4+1) = Joy-Con Left, BIT(N*4+2) = Joy-Con Right, BIT(N*4+3) = invalid. Where N is 0-1.
 +
|-
 +
| 8-10
 +
|
 +
| Pro Controller
 +
|-
 +
| 11
 
|  
 
|  
 
| Famicom left controller
 
| Famicom left controller
Line 952: Line 1,109:  
|}
 
|}
   −
== HdlsState ==
+
u8 values for "nn::hidtypes::DeviceType", must match one of the these values:
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
!  Notes
 +
|-
 +
| 1 || JoyRight ||
 +
|-
 +
| 2 || JoyLeft ||
 +
|-
 +
| 3 || FullKey ||
 +
|-
 +
| 4 || JoyLeft ||
 +
|-
 +
| 5 || JoyRight ||
 +
|-
 +
| 6 || FullKey ||
 +
|-
 +
| 7 || LarkLeft (HVC) ||
 +
|-
 +
| 8 || LarkRight (HVC) ||
 +
|-
 +
| 9 || LarkLeft (NES) ||
 +
|-
 +
| 10 || LarkRight (NES) ||
 +
|-
 +
| 11 || Invalid ||
 +
|-
 +
| 12 || Palma ||
 +
|-
 +
| 13 || FullKey ||
 +
|-
 +
| 14 || Invalid ||
 +
|-
 +
| 15 || FullKey ||
 +
|-
 +
| 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"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 974: Line 1,181:  
|}
 
|}
   −
This is a 0x24-byte struct.
+
[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 =
 
= hid:sys =
 
This is "nn::hid::IHidSystemServer".
 
This is "nn::hid::IHidSystemServer".
Line 1,036: Line 1,261:  
|-
 
|-
 
| 312 || [6.0.0+] SetSupportedNpadStyleSetAll
 
| 312 || [6.0.0+] SetSupportedNpadStyleSetAll
 +
|-
 +
| 313 || [9.0.0+] GetNpadCaptureButtonAssignment
 +
|-
 +
| 314 || [9.0.0+] GetAppletFooterUiType
 +
|-
 +
| 315 || [9.0.0+] GetAppletDetailedUiType
 
|-
 
|-
 
| 321 || [3.0.0+] [[#GetUniquePadsFromNpad]]
 
| 321 || [3.0.0+] [[#GetUniquePadsFromNpad]]
Line 1,066: Line 1,297:  
|-
 
|-
 
| 521 || DisableHandheldHids
 
| 521 || DisableHandheldHids
 +
|-
 +
| 522 || [9.0.0+] SetJoyConRailEnabled
 +
|-
 +
| 523 || [9.0.0+] IsJoyConRailEnabled
 
|-
 
|-
 
| 540 || AcquirePlayReportControllerUsageUpdateEvent
 
| 540 || AcquirePlayReportControllerUsageUpdateEvent
Line 1,140: Line 1,375:  
|-
 
|-
 
| 830 || [7.0.0+] [[#SetNotificationLedPattern]]
 
| 830 || [7.0.0+] [[#SetNotificationLedPattern]]
 +
|-
 +
| 831 || [9.0.0+] [[#SetNotificationLedPatternWithTimeout]]
 +
|-
 +
| 832 || [9.0.0+] [[#PrepareHidsForNotificationWake]]
 
|-
 
|-
 
| 850 || [3.0.0+] IsUsbFullKeyControllerEnabled
 
| 850 || [3.0.0+] IsUsbFullKeyControllerEnabled
Line 1,200: Line 1,439:  
|-
 
|-
 
| 1150 || [8.0.0+] SetTouchScreenMagnification
 
| 1150 || [8.0.0+] SetTouchScreenMagnification
 +
|-
 +
| 1151 || [9.0.0+] GetTouchScreenFirmwareVersion
 +
|-
 +
| 1152 || [9.0.0+] SetTouchScreenDefaultConfiguration
 +
|-
 +
| 1153 || [9.0.0+] GetTouchScreenDefaultConfiguration
 +
|-
 +
| 1154 || [9.0.0+] IsFirmwareAvailableForNotification
 +
|-
 +
| 1155 || [9.0.0+] SetForceHandheldStyleVibration
 +
|-
 +
| 1156 || [9.0.0+] SendConnectionTriggerWithoutTimeoutEvent
 
|}
 
|}
   Line 1,208: 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,216: 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,231: 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,490: Line 1,749:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 500 ||  
+
| 500 || SetAppletResourceUserId
 
|-
 
|-
| 501 ||  
+
| 501 || RegisterAppletResourceUserId
 
|-
 
|-
| 502 ||  
+
| 502 || UnregisterAppletResourceUserId
 
|}
 
|}
   Line 1,664: Line 1,923:  
This is "nn::ahid::IServerSession".
 
This is "nn::ahid::IServerSession".
   −
Used for USB HID devices.  
+
Used for USB HID devices.
 +
 
 +
This service no longer exists in [9.0.0+].
    
{| 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 ==
 
This is "nn::ahid::ICtrlSession".
 
This is "nn::ahid::ICtrlSession".
 +
 +
This no longer exists in [9.0.0+].
    
{| 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 ==
 
This is "nn::ahid::IReadSession".
 
This is "nn::ahid::IReadSession".
 +
 +
This no longer exists in [9.0.0+].
    
{| 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,738: 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,747: Line 2,031:     
Used internally for USB HID devices.
 
Used internally for USB HID devices.
 +
 +
This service no longer exists in [9.0.0+].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,784: Line 2,070:  
| 5 || CheckNfcDevicePower
 
| 5 || CheckNfcDevicePower
 
|-
 
|-
| 6 || [5.0.0+]
+
| 6 || [5.0.0+] SetMcuStateImmediate
 
|-
 
|-
 
| 10 || SetNfcEvent
 
| 10 || SetNfcEvent
Line 1,850: 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
Line 1,877: Line 2,163:     
These titles contain the following files:
 
These titles contain the following files:
* '''ExpectVersionInfo.csv''' - List in the format "[device],[type],[version]" where "device" can be "JoyLeft", "JoyRight", "FullKey" or "Palma", "type" can be "BT", "MCU" or "USB" and "version" is the hexadecimal representation of the firmware file's version.
+
* '''ExpectVersionInfo.csv''' - List in the format "[device],[type],[version]" where "device" can be "JoyLeft", "JoyRight", "FullKey", "Palma" or "Handheld", "type" can be "BT", "MCU", "USB" or "SioH" and "version" is the hexadecimal representation of the firmware file's version.
 
* '''FirmwareInfo.csv''' - List in the format "[device],[type],[version],[file]" where "device", "type" and "version" should match the values from "ExpectVersionInfo" and "file" is the name of the firmware file.
 
* '''FirmwareInfo.csv''' - List in the format "[device],[type],[version],[file]" where "device", "type" and "version" should match the values from "ExpectVersionInfo" and "file" is the name of the firmware file.
 
* '''ukyosakyo_ep2_ota.bin''' - Left/Right Joy-Con BT firmware.
 
* '''ukyosakyo_ep2_ota.bin''' - Left/Right Joy-Con BT firmware.
Line 1,887: Line 2,173:  
* [6.0.0+] '''ProController.dfu''' - Pro Controller USB firmware.
 
* [6.0.0+] '''ProController.dfu''' - Pro Controller USB firmware.
 
* [6.1.0+] '''PalmaFw.bin''' - Poké Ball Plus BT firmware.
 
* [6.1.0+] '''PalmaFw.bin''' - Poké Ball Plus BT firmware.
 +
* [9.0.0+] '''ExpectVersionInfo-platform.hoag.csv''' - Same as "ExpectVersionInfo.csv" but for the Switch Lite platform.
 +
* [9.0.0+] '''FirmwareInfo-platform.hoag.csv''' - Same as "FirmwareInfo.csv" but for the Switch Lite platform.
 +
* [9.0.0+] '''sioh.bin''' - Switch Lite Joy-Con firmware.
 +
* [9.0.0+] '''sioh_iap.bin''' - Switch Lite Joy-Con (IAP profile) firmware.
    
[[Category:Services]]
 
[[Category:Services]]

Navigation menu