Changes

Jump to navigation Jump to search
23,769 bytes added ,  21:45, 31 May 2020
Line 196: Line 196:  
| 406 || [4.0.0+] GetNpadLeftRightInterfaceType
 
| 406 || [4.0.0+] GetNpadLeftRightInterfaceType
 
|-
 
|-
| 407 || [9.0.0+] GetNpadOfHighestBatteryLevelForJoyLeft
+
| 407 || [10.0.0+] GetNpadOfHighestBatteryLevel ([9.0.0+] GetNpadOfHighestBatteryLevelForJoyLeft)
 
|-
 
|-
| 408 || [9.0.0+] GetNpadOfHighestBatteryLevelForJoyRight
+
| 408 || [9.0.0-9.2.0] GetNpadOfHighestBatteryLevelForJoyRight
 
|-
 
|-
 
| 500 || [5.0.0+] GetPalmaConnectionHandle
 
| 500 || [5.0.0+] GetPalmaConnectionHandle
Line 267: Line 267:  
|-
 
|-
 
| 1003 || [9.0.0+] IsFirmwareUpdateNeededForNotification
 
| 1003 || [9.0.0+] IsFirmwareUpdateNeededForNotification
 +
|-
 +
| 2000 || [10.0.0+] ActivateDigitizer
 
|}
 
|}
   Line 382: Line 384:  
== ActivateConsoleSixAxisSensor ==
 
== ActivateConsoleSixAxisSensor ==
 
Takes a PID and an u64 [[AM_services|AppletResourceUserId]], no output.
 
Takes a PID and an u64 [[AM_services|AppletResourceUserId]], no output.
 +
 +
As of [10.0.0+] sdknso no longer uses this.
    
== ActivateSevenSixAxisSensor ==
 
== ActivateSevenSixAxisSensor ==
Line 397: Line 401:  
Takes a PID, an u64 [[AM_services|AppletResourceUserId]], two u64s for the size of each TransferMemory, and two TransferMemory handles. No output.
 
Takes a PID, an u64 [[AM_services|AppletResourceUserId]], two u64s for the size of each TransferMemory, and two TransferMemory handles. No output.
   −
The size of the first TransferMemory is 0x1000 with MemoryPermission=read-only, while the second one has size 0x7F000 with MemoryPermission=none.
+
The size of the first TransferMemory is 0x1000 with MemoryPermission=read-only, while the second one has size 0x7F000 with MemoryPermission=none. sdknso uses an user-specified buffer for this, with the second tmem immediately following the first one. sdknso later uses data at buf+0 for loading SevenSixAxisSensor state.
 +
 
 +
The data at tmem+0 has the following structure:
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x10 || Unused by sdknso.
 +
|-
 +
| 0x10 || 0x8 || Latest entry.
 +
|-
 +
| 0x18 || 0x8 || Total entries.
 +
|-
 +
| 0x20 || 0xA50(0x21*0x50) || Array of the below entries.
 +
|}
 +
 
 +
Entry:
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || Timestamp
 +
|-
 +
| 0x8 || 0x10 || Unused by sdknso.
 +
|-
 +
| 0x10 || 0x40 || SevenSixAxisSensorState
 +
|}
 +
 
 +
SevenSixAxisSensorState:
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || First timestamp.
 +
|-
 +
| 0x8 || 0x8 || Second timestamp (in samples).
 +
|-
 +
| 0x10 || 0x8 || ?
 +
|-
 +
| 0x18 || 0x28 || float data
 +
|}
    
== FinalizeSevenSixAxisSensor ==
 
== FinalizeSevenSixAxisSensor ==
Line 487: Line 534:  
| 50 || DeactivateXpad
 
| 50 || DeactivateXpad
 
|-
 
|-
| 51 || SetXpadAutoPilotState
+
| 51 || [1.0.0-9.2.0] SetXpadAutoPilotState
 
|-
 
|-
| 52 || UnsetXpadAutoPilotState
+
| 52 || [1.0.0-9.2.0] UnsetXpadAutoPilotState
 
|-
 
|-
| 53 ([1.0.0-8.1.0] 60) || [[#DeactivateJoyXpad]]
+
| 53 ([1.0.0-8.1.0] 60) || [1.0.0-9.2.0] [[#DeactivateJoyXpad]]
 
|-
 
|-
 
| 60 || [9.0.0+] ClearNpadSystemCommonPolicy
 
| 60 || [9.0.0+] ClearNpadSystemCommonPolicy
 +
|-
 +
| 61 || [10.0.0+] DeactivateNpad
 +
|-
 +
| 62 || [10.0.0+] ForceDisconnectNpad
 
|-
 
|-
 
| 91 || DeactivateGesture
 
| 91 || DeactivateGesture
Line 509: Line 560:  
| 122 || UnsetSleepButtonAutoPilotState
 
| 122 || UnsetSleepButtonAutoPilotState
 
|-
 
|-
| 123 || DeactivateInputDetector
+
| 123 || [1.0.0-9.2.0] DeactivateInputDetector
 
|-
 
|-
 
| 130 || DeactivateCaptureButton
 
| 130 || DeactivateCaptureButton
Line 548: Line 599:  
|-
 
|-
 
| 151 || [8.0.0+] SetGyroscopeOdr
 
| 151 || [8.0.0+] SetGyroscopeOdr
 +
|-
 +
| 152 || [10.0.0+] GetWhoAmI
 
|-
 
|-
 
| 201 || ActivateFirmwareUpdate
 
| 201 || ActivateFirmwareUpdate
Line 663: Line 716:  
| 401 || [6.0.0+] DisableRailDeviceFiltering
 
| 401 || [6.0.0+] DisableRailDeviceFiltering
 
|-
 
|-
| 500 || [8.0.0+] SetFactoryInt
+
| 402 || [10.0.0+] EnableWiredPairing
 +
|-
 +
| 403 || [10.0.0+] EnableShipmentModeAutoClear
 +
|-
 +
| 500 || [8.0.0+] SetFactoryInt
 
|-
 
|-
 
| 501 || [8.0.0+] IsFactoryBootEnabled
 
| 501 || [8.0.0+] IsFactoryBootEnabled
Line 672: Line 729:  
|-
 
|-
 
| 552 || [9.0.0+] ResetAnalogStickModelData
 
| 552 || [9.0.0+] ResetAnalogStickModelData
 +
|-
 +
| 600 || [10.0.0+] ConvertPadState
 +
|-
 +
| 2000 || [10.0.0+] DeactivateDigitizer
 +
|-
 +
| 2001 || [10.0.0+] SetDigitizerAutoPilotState
 +
|-
 +
| 2002 || [10.0.0+] UnsetDigitizerAutoPilotState
 
|}
 
|}
   Line 695: Line 760:     
== UpdateControllerColor ==
 
== UpdateControllerColor ==
Takes two input u32s for the colors, an input u64 '''UniquePadId''', and no output.
+
Takes two input u32s for the colors, an [[#UniquePadId]], and no output.
    
A state flag must be clear, otherwise an error is thrown. Afterwards, this flag is set.
 
A state flag must be clear, otherwise an error is thrown. Afterwards, this flag is set.
Line 702: Line 767:     
== UpdateDesignInfo ==
 
== UpdateDesignInfo ==
Takes 4 input u32s for the colors, an input u8, an input u64 '''UniquePadId''', and no output.
+
Takes 4 input u32s for the colors, an input u8, an input [[#UniquePadId]], and no output.
    
A state flag must be clear (same as [[#UpdateControllerColor]]), otherwise an error is thrown. Afterwards, this flag is set.
 
A state flag must be clear (same as [[#UpdateControllerColor]]), otherwise an error is thrown. Afterwards, this flag is set.
Line 719: Line 784:     
== AcquireOperationEventHandle ==
 
== AcquireOperationEventHandle ==
Takes an input u64 '''UniquePadId''', returns an output Event handle. The EventClearMode used by official sw is user-specified.
+
Takes an input [[#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 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).
Line 726: Line 791:     
== ReadSerialFlash ==
 
== ReadSerialFlash ==
Takes an input TransferMemory handle, an input u32 offset, an input u64 size, and an u64 '''UniquePadId''', no output.
+
Takes an input TransferMemory handle, an input u32 offset, an input u64 size, and an [[#UniquePadId]], no output.
    
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-.
Line 735: Line 800:     
== WriteSerialFlash ==
 
== 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.
+
Takes an input TransferMemory handle, an input u32 offset, an input u64 tmem_size, an input u64 size, and an [[#UniquePadId]], no output.
    
Writes to the specified controller's spi-flash. The TransferMemory permissions is R--.
 
Writes to the specified controller's spi-flash. The TransferMemory permissions is R--.
Line 744: Line 809:     
== GetOperationResult ==
 
== GetOperationResult ==
Takes an input u64 '''UniquePadId''', no output.
+
Takes an input [[#UniquePadId]], no output.
    
Get the Result for the Operation and handles cleanup, for the specified controller.
 
Get the Result for the Operation and handles cleanup, for the specified controller.
Line 751: Line 816:     
== GetUniquePadDeviceTypeSetInternal ==
 
== GetUniquePadDeviceTypeSetInternal ==
Takes an input u64 '''UniquePadId''', returns an [[#DeviceTypeInternal]].
+
Takes an input [[#UniquePadId]], returns an [[#DeviceTypeInternal]].
    
== GetAbstractedPadHandles ==
 
== GetAbstractedPadHandles ==
Line 860: Line 925:  
|-
 
|-
 
| 231 || ActivateIrSensor
 
| 231 || ActivateIrSensor
 +
|-
 +
| 232 || [10.0.0+] GetIrSensorState
 +
|-
 +
| 233 || [10.0.0+] GetXcdHandleForNpadWithIrSensor
 
|-
 
|-
 
| 301 || ActivateNpadSystem
 
| 301 || ActivateNpadSystem
Line 888: Line 957:  
|-
 
|-
 
| 315 || [9.0.0+] GetAppletDetailedUiType
 
| 315 || [9.0.0+] GetAppletDetailedUiType
 +
|-
 +
| 316 || [10.0.0+] GetNpadInterfaceType
 +
|-
 +
| 317 || [10.0.0+] GetNpadLeftRightInterfaceType
 +
|-
 +
| 318 || [10.0.0+] HasBattery
 +
|-
 +
| 319 || [10.0.0+] HasLeftRightBattery
 
|-
 
|-
 
| 321 || [3.0.0+] [[#GetUniquePadsFromNpad]]
 
| 321 || [3.0.0+] [[#GetUniquePadsFromNpad]]
 
|-
 
|-
| 322 || GetIrSensorState
+
| 322 || [10.0.0+] SetNpadSystemExtStateEnabled ([1.0.0-9.2.0] GetIrSensorState)
 
|-
 
|-
| 323 || GetXcdHandleForNpadWithIrSensor
+
| 323 || [10.0.0+] GetLastActiveUniquePad ([1.0.0-9.2.0] GetXcdHandleForNpadWithIrSensor)
 +
|-
 +
| 324 || [10.0.0+] GetUniquePadButtonSet
 +
|-
 +
| 325 || [10.0.0+] GetUniquePadColor
 +
|-
 +
| 326 || [10.0.0+] GetUniquePadAppletDetailedUiType
 
|-
 
|-
 
| 500 || SetAppletResourceUserId
 
| 500 || SetAppletResourceUserId
Line 922: Line 1,005:  
|-
 
|-
 
| 523 || [9.0.0+] IsJoyConRailEnabled
 
| 523 || [9.0.0+] IsJoyConRailEnabled
 +
|-
 +
| 524 || [10.0.0+] IsHandheldHidsEnabled
 
|-
 
|-
 
| 540 || AcquirePlayReportControllerUsageUpdateEvent
 
| 540 || AcquirePlayReportControllerUsageUpdateEvent
Line 1,009: Line 1,094:  
| 870 || [5.1.0+] IsHandheldButtonPressedOnConsoleMode
 
| 870 || [5.1.0+] IsHandheldButtonPressedOnConsoleMode
 
|-
 
|-
| 900 || ActivateInputDetector
+
| 900 || [1.0.0-9.2.0] ActivateInputDetector
 
|-
 
|-
| 901 || [[#NotifyInputDetector]]
+
| 901 || [1.0.0-9.2.0] [[#NotifyInputDetector]]
 
|-
 
|-
 
| 1000 || [3.0.0+] InitializeFirmwareUpdate
 
| 1000 || [3.0.0+] InitializeFirmwareUpdate
Line 1,072: Line 1,157:  
|-
 
|-
 
| 1156 || [9.0.0+] SendConnectionTriggerWithoutTimeoutEvent
 
| 1156 || [9.0.0+] SendConnectionTriggerWithoutTimeoutEvent
|}
  −
  −
== GetMaskedSupportedNpadStyleSet ==
  −
Takes an input u64 AppletResourceUserId, returns an output u32 [[#NpadStyleTag]].
  −
  −
Official sw uses the output from [[Applet_Manager_services|GetAppletResourceUserIdOfCallerApplet]] with this.
  −
  −
== GetUniquePadsFromNpad ==
  −
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'''.
  −
  −
== SetVibrationMasterVolume ==
  −
Takes an input 32bit float.
  −
  −
== GetUniquePadIds ==
  −
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'''.
  −
  −
== GetUniquePadType ==
  −
Takes an input u64 '''UniquePadId''' and returns an output u64 [[#UniquePadType]].
  −
  −
== SetNotificationLedPattern ==
  −
Takes an input [[#NotificationLedPattern]] and an u64 '''UniquePadId''', no output.
  −
  −
The specified controller must have a HOME button.
  −
  −
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.
  −
  −
== NotifyInputDetector ==
  −
Takes an input u32 bitmask InputSourceId, no output.
  −
  −
This is the only hid:sys command used by USB-sysmodule (with value 0x40).
  −
  −
== GetHidbusSystemServiceObject ==
  −
No input, returns an [[#IHidbusSystemServer]].
  −
  −
== IHidbusSystemServer ==
  −
This is "nn::hidbus::IHidbusSystemServer".
  −
  −
This was added with [5.0.0+].
  −
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Cmd || Name
+
| 1157 || [10.0.0+] [[#CancelConnectionTrigger]]
 +
|-
 +
| 1200 || [10.0.0+] [[#IsButtonConfigSupported]]
 +
|-
 +
| 1201 || [10.0.0+] [[#DeleteButtonConfig]]
 +
|-
 +
| 1202 || [10.0.0+] [[#SetButtonConfigEnabled]]
 +
|-
 +
| 1203 || [10.0.0+] [[#IsButtonConfigEnabled]]
 +
|-
 +
| 1204 || [10.0.0+] [[#SetButtonConfigEmbedded]]
 +
|-
 +
| 1205 || [10.0.0+] [[#SetButtonConfigFull]]
 +
|-
 +
| 1206 || [10.0.0+] [[#SetButtonConfigLeft]]
 +
|-
 +
| 1207 || [10.0.0+] [[#SetButtonConfigRight]]
 +
|-
 +
| 1208 || [10.0.0+] [[#GetButtonConfigEmbedded]]
 +
|-
 +
| 1209 || [10.0.0+] [[#GetButtonConfigFull]]
 +
|-
 +
| 1210 || [10.0.0+] [[#GetButtonConfigLeft]]
 +
|-
 +
| 1211 || [10.0.0+] [[#GetButtonConfigRight]]
 +
|-
 +
| 1250 || [10.0.0+] [[#IsCustomButtonConfigSupported]]
 +
|-
 +
| 1251 || [10.0.0+] [[#IsDefaultButtonConfigEmbedded]]
 +
|-
 +
| 1252 || [10.0.0+] [[#IsDefaultButtonConfigFull]]
 +
|-
 +
| 1253 || [10.0.0+] [[#IsDefaultButtonConfigLeft]]
 +
|-
 +
| 1254 || [10.0.0+] [[#IsDefaultButtonConfigRight]]
 +
|-
 +
| 1255 || [10.0.0+] [[#IsButtonConfigStorageEmbeddedEmpty]]
 +
|-
 +
| 1256 || [10.0.0+] [[#IsButtonConfigStorageFullEmpty]]
 +
|-
 +
| 1257 || [10.0.0+] [[#IsButtonConfigStorageLeftEmpty]]
 +
|-
 +
| 1258 || [10.0.0+] [[#IsButtonConfigStorageRightEmpty]]
 +
|-
 +
| 1259 || [10.0.0+] [[#GetButtonConfigStorageEmbedded]]
 +
|-
 +
| 1260 || [10.0.0+] [[#GetButtonConfigStorageFull]]
 +
|-
 +
| 1261 || [10.0.0+] [[#GetButtonConfigStorageLeft]]
 +
|-
 +
| 1262 || [10.0.0+] [[#GetButtonConfigStorageRight]]
 +
|-
 +
| 1263 || [10.0.0+] [[#SetButtonConfigStorageEmbedded]]
 +
|-
 +
| 1264 || [10.0.0+] [[#SetButtonConfigStorageFull]]
 +
|-
 +
| 1265 || [10.0.0+] [[#SetButtonConfigStorageLeft]]
 +
|-
 +
| 1266 || [10.0.0+] [[#SetButtonConfigStorageRight]]
 +
|-
 +
| 1267 || [10.0.0+] [[#DeleteButtonConfigStorageEmbedded]]
 +
|-
 +
| 1268 || [10.0.0+] [[#DeleteButtonConfigStorageFull]]
 +
|-
 +
| 1269 || [10.0.0+] [[#DeleteButtonConfigStorageLeft]]
 
|-
 
|-
| 500 || SetAppletResourceUserId
+
| 1270 || [10.0.0+] [[#DeleteButtonConfigStorageRight]]
 
|-
 
|-
| 501 || RegisterAppletResourceUserId
+
| 1271 || [10.0.0+] [[#IsUsingCustomButtonConfig]]
 
|-
 
|-
| 502 || UnregisterAppletResourceUserId
+
| 1272 || [10.0.0+] [[#IsAnyCustomButtonConfigEnabled]]
|}
  −
 
  −
= hid:tmp =
  −
This is "nn::hid::IHidTemporaryServer".
  −
 
  −
This service was added with [3.0.0+], then removed with [8.0.0+].
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Cmd || Name
+
| 1273 || [10.0.0+] [[#SetAllCustomButtonConfigEnabled]]
 
|-
 
|-
| 0 || GetConsoleSixAxisSensorCalibrationValues
+
| 1274 || [10.0.0+] [[#SetDefaultButtonConfig]]
|}
  −
 
  −
= irs =
  −
This is "nn::irsensor::IIrSensorServer".
  −
 
  −
This was added to sdknso with 3.x.
  −
 
  −
With sdknso versions pre-4.x PointingProcessor used to be DpdProcessor. The [[#PackedPointingProcessorConfig|packed-config]] with DpdProcessor (besides RequiredMcuVersion) used to be initialized from user-specified config, now it's hard-coded.
  −
 
  −
{| class="wikitable" border="1"
  −
|-
  −
! Cmd || Name
  −
|-
  −
| 302 || [[#ActivateIrsensor]]
  −
|-
  −
| 303 || [[#DeactivateIrsensor]]
  −
|-
  −
| 304 || [[#GetIrsensorSharedMemoryHandle]]
   
|-
 
|-
| 305 || [[#StopImageProcessor]]
+
| 1275 || [10.0.0+] [[#SetAllDefaultButtonConfig]]
 
|-
 
|-
| 306 || [[#RunMomentProcessor]]
+
| 1276 || [10.0.0+] [[#SetHidButtonConfigEmbedded]]
 
|-
 
|-
| 307 || [[#RunClusteringProcessor]]
+
| 1277 || [10.0.0+] [[#SetHidButtonConfigFull]]
 
|-
 
|-
| 308 || [[#RunImageTransferProcessor]]
+
| 1278 || [10.0.0+] [[#SetHidButtonConfigLeft]]
 
|-
 
|-
| 309 || [[#GetImageTransferProcessorState]]
+
| 1279 || [10.0.0+] [[#SetHidButtonConfigRight]]
 
|-
 
|-
| 310 || [[#RunTeraPluginProcessor]]
+
| 1280 || [10.0.0+] [[#GetHidButtonConfigEmbedded]]
 
|-
 
|-
| 311 || [[#GetNpadIrCameraHandle]]
+
| 1281 || [10.0.0+] [[#GetHidButtonConfigFull]]
 
|-
 
|-
| 312 || [[#RunPointingProcessor]]
+
| 1282 || [10.0.0+] [[#GetHidButtonConfigLeft]]
 
|-
 
|-
| 313 || [[#SuspendImageProcessor]]
+
| 1283 || [10.0.0+] [[#GetHidButtonConfigRight]]
|-
+
|}
| 314 || [3.0.0+] [[#CheckFirmwareVersion]]
+
 
|-
+
== GetMaskedSupportedNpadStyleSet ==
| 315 || [4.0.0+] [[#SetFunctionLevel]]
+
Takes an input u64 AppletResourceUserId, returns an output u32 [[#NpadStyleTag]].
|-
+
 
| 316 || [4.0.0+] [[#RunImageTransferExProcessor]]
+
Official sw uses the output from [[Applet_Manager_services|GetAppletResourceUserIdOfCallerApplet]] with this.
|-
+
 
| 317 || [4.0.0+] [[#RunIrLedProcessor]]
+
== GetUniquePadsFromNpad ==
|-
+
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).
| 318 || [4.0.0+] [[#StopImageProcessorAsync]]
  −
|-
  −
| 319 || [4.0.0+] [[#ActivateIrsensorWithFunctionLevel]]
  −
|}
     −
== ActivateIrsensor ==
+
The output buffer contains an array of [[#UniquePadId]].
Takes a PID-descriptor and an [[AM_services|AppletResourceUserId]]. No output.
     −
== DeactivateIrsensor ==
+
== SetVibrationMasterVolume ==
Takes a PID-descriptor and an [[AM_services|AppletResourceUserId]]. No output.
+
Takes an input 32bit float.
   −
== GetIrsensorSharedMemoryHandle ==
+
== GetUniquePadIds ==
Takes a PID-descriptor and an [[AM_services|AppletResourceUserId]]. Returns a SharedMemory handle.
+
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 SharedMemory is "nn::irsensor::detail::StatusManager". It's mapped with permission read-only and size 0x8000.
+
The output buffer contains an array of [[#UniquePadId]].
   −
It's structure is as follows:
+
== GetUniquePadType ==
 +
Takes an input [[#UniquePadId]] and returns an output u64 [[#UniquePadType]].
   −
{| class="wikitable" border="1"
+
== SetNotificationLedPattern ==
|-
+
Takes an input [[#NotificationLedPattern]] and an [[#UniquePadId]], no output.
! Offset || Size || Description
  −
|-
  −
| 0x0 || 0x7FB0 || Array of [[#DeviceFormat]]
  −
|-
  −
| 0x7FB0 || 0x50 || Array of [[#AruidFormat]]
  −
|}
     −
The array of [[#DeviceFormat]] is indexed by [[#IrCameraHandle|PlayerNumber]] and can hold up to 9 entries. The array of [[#AruidFormat]] can only hold up to 5 entries.
+
The specified controller must have a HOME button.
   −
=== DeviceFormat ===
+
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].
{| class="wikitable" border="1"
  −
|-
  −
! Offset || Size || Description
  −
|-
  −
| 0x0 || 0x4 || [[#IrCameraStatus]]
  −
|-
  −
| 0x4 || 0x4 || [[#IrCameraInternalStatus]]
  −
|-
  −
| 0x8 || 0x8 || [[#IrSensorMode]]
  −
|-
  −
| 0x10 || 0xE20 || Array of ProcessorState
  −
|}
     −
ProcessorState is specialized depending on the value of [[#IrSensorMode]].
+
[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}).
   −
The array of ProcessorState can hold up to 6 entries of [[#PointingProcessorState]] or 5 entries of any of the other states.  
+
== SetNotificationLedPatternWithTimeout ==
 +
Takes an input [[#NotificationLedPattern]], an [[#UniquePadId]], and an s64 TimeSpan, no output.
   −
==== MomentProcessorState ====
+
== PrepareHidsForNotificationWake ==
{| class="wikitable" border="1"
+
Takes a type-0x9 input buffer containing an array of [[#UniquePadId]], no output.
|-
  −
! Offset || Size || Description
  −
|-
  −
| 0x0 || 0x8 || SamplingNumber
  −
|-
  −
| 0x8 || 0x8 || TimeStamp
  −
|-
  −
| 0x10 || 0x4 || AmbientNoiseLevel
  −
|-
  −
| 0x14 || 0x4 || Reserved
  −
|-
  −
| 0x18 || 0x240 || Array of [[#MomentStatistic]]
  −
|}
     −
The array of [[#MomentStatistic]] can hold up to 48 entries.
+
== NotifyInputDetector ==
 +
Takes an input u32 bitmask InputSourceId, no output.
   −
===== MomentStatistic =====
+
This is the only hid:sys command used by USB-sysmodule (with value 0x40).
{| class="wikitable" border="1"
+
 
|-
+
== GetHidbusSystemServiceObject ==
! Offset || Size || Description
+
No input, returns an [[#IHidbusSystemServer]].
|-
+
 
| 0x0 || 0x4 || AverageIntensity
+
== CancelConnectionTrigger ==
|-
+
Takes an input "nn::bluetooth::Address", no output.
| 0x4 || 0x4 || CentroidX
+
 
|-
+
== IsButtonConfigSupported ==
| 0x8 || 0x4 || CentroidY
+
Takes an input [[#UniquePadId]], returns an output bool.
|}
+
 
 +
== DeleteButtonConfig ==
 +
Takes an input [[#UniquePadId]], no output.
 +
 
 +
== SetButtonConfigEnabled ==
 +
Takes an input bool, an [[#UniquePadId]], no output.
   −
==== ClusteringProcessorState ====
+
== IsButtonConfigEnabled ==
{| class="wikitable" border="1"
+
Takes an input [[#UniquePadId]], returns an output bool.
|-
  −
! Offset || Size || Description
  −
|-
  −
| 0x0 || 0x8 || SamplingNumber
  −
|-
  −
| 0x8 || 0x8 || TimeStamp
  −
|-
  −
| 0x10 || 0x1 || ObjectCount
  −
|-
  −
| 0x11 || 0x3 || Reserved
  −
|-
  −
| 0x14 || 0x4 || AmbientNoiseLevel
  −
|-
  −
| 0x18 || 0x180 || Array of [[#ClusteringData]]
  −
|}
     −
The array of [[#ClusteringData]] can hold up to 16 entries.
+
== SetButtonConfigEmbedded ==
 +
Takes an input [[#UniquePadId]], a type-0x15 input buffer containing a [[#SystemButtonConfigEmbedded]], no output.
   −
===== ClusteringData =====
+
== SetButtonConfigFull ==
{| class="wikitable" border="1"
+
Takes an input [[#UniquePadId]], a type-0x15 input buffer containing a [[#SystemButtonConfigFull]], no output.
|-
+
 
! Offset || Size || Description
+
== SetButtonConfigLeft ==
|-
+
Takes an input [[#UniquePadId]], a type-0x15 input buffer containing a [[#SystemButtonConfigLeft]], no output.
| 0x0 || 0x4 || AverageIntensity
+
 
|-
+
== SetButtonConfigRight ==
| 0x4 || 0x4 || CentroidX
+
Takes an input [[#UniquePadId]], a type-0x15 input buffer containing a [[#SystemButtonConfigRight]], no output.
|-
+
 
| 0x8 || 0x4 || CentroidY
+
== GetButtonConfigEmbedded ==
|-
+
Takes an input [[#UniquePadId]], and a type-0x16 output buffer containing a [[#SystemButtonConfigEmbedded]].
| 0xC || 0x4 || PixelCount
  −
|-
  −
| 0x10 || 0x2 || BoundX
  −
|-
  −
| 0x12 || 0x2 || BoundY
  −
|-
  −
| 0x14 || 0x2 || BoundtWidth
  −
|-
  −
| 0x16 || 0x2 || BoundHeight
  −
|}
     −
==== PointingProcessorState ====
+
== GetButtonConfigFull ==
{| class="wikitable" border="1"
+
Takes an input [[#UniquePadId]], and a type-0x16 output buffer containing a [[#SystemButtonConfigFull]].
|-
  −
! Offset || Size || Description
  −
|-
  −
| 0x0 || 0x8 || SamplingNumber
  −
|-
  −
| 0x8 || 0x8 || TimeStamp
  −
|-
  −
| 0x10 || 0x60 || Unknown
  −
|}
     −
==== TeraPluginProcessorState ====
+
== GetButtonConfigLeft ==
{| class="wikitable" border="1"
+
Takes an input [[#UniquePadId]], and a type-0x16 output buffer containing a [[#SystemButtonConfigLeft]].
|-
  −
! Offset || Size || Description
  −
|-
  −
| 0x0 || 0x8 || SamplingNumber
  −
|-
  −
| 0x8 || 0x8 || TimeStamp
  −
|-
  −
| 0x10 || 0x130 || Unknown
  −
|}
     −
=== AruidFormat ===
+
== GetButtonConfigRight ==
{| class="wikitable" border="1"
+
Takes an input [[#UniquePadId]], and a type-0x16 output buffer containing a [[#SystemButtonConfigRight]].
|-
  −
! Offset || Size || Description
  −
|-
  −
| 0x0 || 0x8 || IrSensorAruid
  −
|-
  −
| 0x8 || 0x8 || IrSensorAruidStatus
  −
|}
     −
== StopImageProcessor ==
+
== IsCustomButtonConfigSupported ==
Takes a PID-descriptor, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. No output.
+
Takes an input [[#UniquePadId]], returns an output bool.
   −
== RunMomentProcessor ==
+
== IsDefaultButtonConfigEmbedded ==
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], and a [[#PackedMomentProcessorConfig]]. No output.
+
Takes a type-0x15 input buffer containing a [[#ButtonConfigEmbedded]], returns an output bool.
   −
== RunClusteringProcessor ==
+
This compares the input config with config in state, sets the output bool to whether these match, then returns 0.
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], and a [[#PackedClusteringProcessorConfig]]. No output.
     −
== RunImageTransferProcessor ==
+
== IsDefaultButtonConfigFull ==
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], a [[#PackedImageTransferProcessorConfig]], an u64 for the TransferMemory's size, and a TransferMemory handle. No output.
+
Takes a type-0x15 input buffer containing a [[#ButtonConfigFull]], returns an output bool.
   −
The TransferMemory is created with an user specified buffer and permission none.
+
This compares the input config with config in state, sets the output bool to whether these match, then returns 0.
   −
== GetImageTransferProcessorState ==
+
== IsDefaultButtonConfigLeft ==
Takes a PID-descriptor, a type-0x6 output buffer, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. Returns an [[#ImageTransferProcessorState]]. No output.
+
Takes a type-0x15 input buffer containing a [[#ButtonConfigLeft]], returns an output bool.
   −
== RunTeraPluginProcessor==
+
This compares the input config with config in state, sets the output bool to whether these match, then returns 0.
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedTeraPluginProcessorConfig]] (immediately after the previous word), and an [[AM_services|AppletResourceUserId]]. No output.
     −
== GetNpadIrCameraHandle ==
+
== IsDefaultButtonConfigRight ==
Takes an input [[#NpadIdType]]. Returns an output [[#IrCameraHandle]].
+
Takes a type-0x15 input buffer containing a [[#ButtonConfigRight]], returns an output bool.
   −
== RunPointingProcessor ==
+
This compares the input config with config in state, sets the output bool to whether these match, then returns 0.
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedPointingProcessorConfig]] (immediately after the previous word), and an [[AM_services|AppletResourceUserId]]. No output.
     −
== SuspendImageProcessor ==
+
== IsButtonConfigStorageEmbeddedEmpty ==
Takes a PID-descriptor, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. No output.
+
Takes an input s32 entry-index, returns an output bool.
   −
sdknso uses this from the Run*Processor funcs to suspend the current Processor when the current [[#PackedFunctionLevel|FunctionLevel]] is >= 0x1, prior to starting another Processor if needed (depending on  what Processor was already active via a state field). Hence, this cmd is only used with [4.0.0+].
+
Uses [[Settings_services#GetButtonConfigSettingsEmbedded|GetButtonConfigSettingsEmbedded]] with count=5 (output s32 ignored). The input entry-index is used with this array. Then the output bool is set to [[Settings_services#ButtonConfigSettings|IsFull]] bit0 == 0. Then 0 is returned.
   −
== CheckFirmwareVersion ==
+
== IsButtonConfigStorageFullEmpty ==
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedMcuVersion]], and an [[AM_services|AppletResourceUserId]]. No output.
+
Takes an input s32 entry-index, returns an output bool.
   −
sdknso didn't actually use this until 4.x (the RequiredMcuVersion was also updated with that version).
+
Same as [[#IsButtonConfigStorageEmbeddedEmpty]] except with a different setsys cmd.
   −
== SetFunctionLevel ==
+
== IsButtonConfigStorageLeftEmpty ==
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedFunctionLevel]], and an [[AM_services|AppletResourceUserId]]. No output.
+
Takes an input s32 entry-index, returns an output bool.
   −
== RunImageTransferExProcessor ==
+
Same as [[#IsButtonConfigStorageEmbeddedEmpty]] except with a different setsys cmd.
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], a [[#PackedImageTransferProcessorExConfig]], an u64 for the TransferMemory's size, and a TransferMemory handle. No output.
     −
The TransferMemory is created with an user specified buffer and permission none.
+
== IsButtonConfigStorageRightEmpty ==
 +
Takes an input s32 entry-index, returns an output bool.
   −
== RunIrLedProcessor ==
+
Same as [[#IsButtonConfigStorageEmbeddedEmpty]] except with a different setsys cmd.
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedIrLedProcessorConfig]] (immediately after the previous word), and an [[AM_services|AppletResourceUserId]]. No output.
     −
== StopImageProcessorAsync ==
+
== GetButtonConfigStorageEmbedded ==
Takes a PID-descriptor, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. No output.
+
Takes an input s32 entry-index, and a type-0x16 output buffer containing a [[#ButtonConfigEmbedded]].
 +
 
 +
Uses [[Settings_services#GetButtonConfigSettingsEmbedded|GetButtonConfigSettingsEmbedded]] with count=5 (output s32 ignored). The input entry-index is used with this array. Then an error is thrown if [[Settings_services#ButtonConfigSettings|IsFull]] bit0 is clear. Then the data at +0x1C8 is converted to [[#ButtonConfigEmbedded]], copied to output, and returns 0.
 +
 
 +
== GetButtonConfigStorageFull ==
 +
Takes an input s32 entry-index, and a type-0x16 output buffer containing a [[#ButtonConfigFull]].
 +
 
 +
Same as [[#GetButtonConfigStorageEmbedded]], except this uses a different setsys cmd, and uses a different conversion func / different output struct.
   −
== ActivateIrsensorWithFunctionLevel ==
+
== GetButtonConfigStorageLeft ==
Takes a PID-descriptor, an [[#PackedFunctionLevel]], and an [[AM_services|AppletResourceUserId]]. No output.
+
Takes an input s32 entry-index, and a type-0x16 output buffer containing a [[#ButtonConfigLeft]].
   −
= irs:sys =
+
Same as [[#GetButtonConfigStorageEmbedded]], except this uses a different setsys cmd, and uses a different conversion func / different output struct.
This is "nn::irsensor::IIrSensorSystemServer".
     −
{| class="wikitable" border="1"
+
== GetButtonConfigStorageRight ==
|-
+
Takes an input s32 entry-index, and a type-0x16 output buffer containing a [[#ButtonConfigRight]].
! Cmd || Name
  −
|-
  −
| 500 || [[#SetAppletResourceUserId]]
  −
|-
  −
| 501 || [[#RegisterAppletResourceUserId]]
  −
|-
  −
| 502 || [[#UnregisterAppletResourceUserId]]
  −
|-
  −
| 503 || [[#EnableAppletToGetInput]]
  −
|}
     −
== SetAppletResourceUserId ==
+
Same as [[#GetButtonConfigStorageEmbedded]], except this uses a different setsys cmd, and uses a different conversion func / different output struct.
Takes an [[AM_services|AppletResourceUserId]]. No output.
     −
== RegisterAppletResourceUserId ==
+
== SetButtonConfigStorageEmbedded ==
Takes a bool and an [[AM_services|AppletResourceUserId]]. No output.
+
Takes an input s32 entry-index, and a type-0x15 input buffer containing a [[#ButtonConfigEmbedded]].
   −
== UnregisterAppletResourceUserId ==
+
If the input config matches the [[#IsDefaultButtonConfigEmbedded|default]], this first does:
Takes an [[AM_services|AppletResourceUserId]]. No output.
+
* Uses [[Settings_services#GetButtonConfigSettingsEmbedded|GetButtonConfigSettingsEmbedded]] with count=5 (output s32 ignored). The input entry-index is used with this array. When [[Settings_services#ButtonConfigSettings|IsFull]] is set, the config is deleted the same way as [[#DeleteButtonConfigStorageEmbedded]] (following the IsFull check).
   −
== EnableAppletToGetInput ==
+
Afterwards, this uses [[Settings_services#GetButtonConfigSettingsEmbedded|GetButtonConfigSettingsEmbedded]] with count=5 (output s32 ignored). The input entry-index is used with this array. The input struct is converted, the output from that is copied to +0x1C8 size 0x3E0, IsFull is set, [[Settings_services#SetButtonConfigSettingsEmbedded|SetButtonConfigSettingsEmbedded]] is used with the updated array, and then returns 0.
Takes a bool and an [[AM_services|AppletResourceUserId]]. No output.
     −
= ahid:cd =
+
== SetButtonConfigStorageFull ==
This is "nn::ahid::IServerSession".
+
Takes an input s32 entry-index, and a type-0x15 input buffer containing a [[#ButtonConfigFull]].
   −
Used for USB HID devices.
+
Same as [[#SetButtonConfigStorageEmbedded]], except this uses different setsys cmds, and uses a different structs etc.
   −
This service no longer exists in [9.0.0+].
+
== SetButtonConfigStorageLeft ==
 +
Takes an input s32 entry-index, and a type-0x15 input buffer containing a [[#ButtonConfigLeft]].
   −
{| class="wikitable" border="1"
+
Same as [[#SetButtonConfigStorageEmbedded]], except this uses different setsys cmds, and uses a different structs etc.
|-
+
 
! Cmd || Name
+
== SetButtonConfigStorageRight ==
|-
+
Takes an input s32 entry-index, and a type-0x15 input buffer containing a [[#ButtonConfigRight]].
| 0 || [[#AcquireDevice]]
+
 
|-
+
Same as [[#SetButtonConfigStorageEmbedded]], except this uses different setsys cmds, and uses a different structs etc.
| 1 || [[#ReleaseDevice]]
+
 
|-
+
== DeleteButtonConfigStorageEmbedded ==
| 2 || [[#GetCtrlSession]]
+
Takes an input s32 entry-index, no output.
|-
+
 
| 3 || [[#GetReadSession]]
+
Uses [[Settings_services#GetButtonConfigSettingsEmbedded|GetButtonConfigSettingsEmbedded]] with count=5 (output s32 ignored). The input entry-index is used with this array. Then an error is thrown if [[Settings_services#ButtonConfigSettings|IsFull]] bit0 is clear. Then the data at +0x1C8 size 0x3E0 is cleared, IsFull bit0 is cleared, [[Settings_services#SetButtonConfigSettingsEmbedded|SetButtonConfigSettingsEmbedded]] is used with the updated array, and then returns 0.
|-
+
 
| 4 || [1.0.0-2.3.0] [[#GetWriteSession]]
+
== DeleteButtonConfigStorageFull ==
|}
+
Takes an input s32 entry-index, no output.
 +
 
 +
Same as [[#IsButtonConfigStorageEmbeddedEmpty]] except with different setsys cmds.
   −
== AcquireDevice ==
+
== DeleteButtonConfigStorageLeft ==
Takes an input s32, no output.
+
Takes an input s32 entry-index, no output.
   −
== ReleaseDevice ==
+
Same as [[#IsButtonConfigStorageEmbeddedEmpty]] except with different setsys cmds.
Takes an input s32, no output.
     −
== GetCtrlSession ==
+
== DeleteButtonConfigStorageRight ==
Takes an input u32, returns an [[#ICtrlSession]].
+
Takes an input s32 entry-index, no output.
   −
== GetReadSession ==
+
Same as [[#IsButtonConfigStorageEmbeddedEmpty]] except with different setsys cmds.
Takes an input u32, returns an [[#IReadSession]].
     −
== GetWriteSession ==
+
== IsUsingCustomButtonConfig ==
Takes an input u32, returns an [[#IWriteSession]].
+
Takes an input [[#UniquePadId]], returns an output bool.
   −
== ICtrlSession ==
+
== IsAnyCustomButtonConfigEnabled ==
This is "nn::ahid::ICtrlSession".
+
No input, returns an output bool.
   −
This no longer exists in [9.0.0+].
+
== SetAllCustomButtonConfigEnabled ==
 +
Takes an input bool and an AppletResourceUserId, no output.
   −
{| class="wikitable" border="1"
+
== SetDefaultButtonConfig ==
|-
+
Takes an input [[#UniquePadId]], no output.
! Cmd || Name
+
 
|-
+
== SetAllDefaultButtonConfig ==
| 0 || GetString
+
No input/output.
|-
+
 
| 1 || GetCodeBook
+
== SetHidButtonConfigEmbedded ==
 +
Takes an input [[#UniquePadId]] and a type-0x15 input buffer containing a [[#ButtonConfigEmbedded]], no output.
 +
 
 +
== SetHidButtonConfigFull ==
 +
Takes an input [[#UniquePadId]] and a type-0x15 input buffer containing a [[#ButtonConfigFull]], no output.
 +
 
 +
== SetHidButtonConfigLeft ==
 +
Takes an input [[#UniquePadId]] and a type-0x15 input buffer containing a [[#ButtonConfigLeft]], no output.
 +
 
 +
== SetHidButtonConfigRight ==
 +
Takes an input [[#UniquePadId]] and a type-0x15 input buffer containing a [[#ButtonConfigRight]], no output.
 +
 
 +
== GetHidButtonConfigEmbedded ==
 +
Takes an input [[#UniquePadId]], and a type-0x16 output buffer containing a [[#ButtonConfigEmbedded]].
 +
 
 +
== GetHidButtonConfigFull ==
 +
Takes an input [[#UniquePadId]], and a type-0x16 output buffer containing a [[#ButtonConfigFull]].
 +
 
 +
== GetHidButtonConfigLeft ==
 +
Takes an input [[#UniquePadId]], and a type-0x16 output buffer containing a [[#ButtonConfigLeft]].
 +
 
 +
== GetHidButtonConfigRight ==
 +
Takes an input [[#UniquePadId]], and a type-0x16 output buffer containing a [[#ButtonConfigRight]].
 +
 
 +
== IHidbusSystemServer ==
 +
This is "nn::hidbus::IHidbusSystemServer".
 +
 
 +
This was added with [5.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 2 || GetReport
+
! Cmd || Name
 
|-
 
|-
| 3 || SetReport
+
| 500 || SetAppletResourceUserId
 
|-
 
|-
| 4 || GetIdle
+
| 501 || RegisterAppletResourceUserId
 
|-
 
|-
| 5 || SetIdle
+
| 502 || UnregisterAppletResourceUserId
 +
|}
 +
 
 +
= hid:tmp =
 +
This is "nn::hid::IHidTemporaryServer".
 +
 
 +
This service was added with [3.0.0+], then removed with [8.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 6 || GetProtocol
+
! Cmd || Name
 
|-
 
|-
| 7 || SetProtocol
+
| 0 || GetConsoleSixAxisSensorCalibrationValues
|-
  −
| 8 || GetDescriptor
  −
|-
  −
| 9 || SetDescriptor
  −
|-
  −
| 10 || GetStateChangeEvent
  −
|-
  −
| 11 || SignalStateChangeEvent
  −
|-
  −
| 12 || [3.0.0+] Write
   
|}
 
|}
   −
All of these use USB [[USB_services|CtrlXfer]], except for GetStateChangeEvent and SignalStateChangeEvent, and GetCodeBook which copies 0x4000-bytes from state to output.
+
= irs =
 +
This is "nn::irsensor::IIrSensorServer".
   −
== IReadSession ==
+
This was added to sdknso with 3.x.
This is "nn::ahid::IReadSession".
     −
This no longer exists in [9.0.0+].
+
With sdknso versions pre-4.x PointingProcessor used to be DpdProcessor. The [[#PackedPointingProcessorConfig|packed-config]] with DpdProcessor (besides RequiredMcuVersion) used to be initialized from user-specified config, now it's hard-coded.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,507: Line 1,520:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || [[#Read]]
+
| 302 || [[#ActivateIrsensor]]
|}
  −
 
  −
=== 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+] Now takes a total of 8-bytes of input.
  −
 
  −
== IWriteSession ==
  −
This is "nn::ahid::IWriteSession".
  −
 
  −
This was removed with [3.0.0+].
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Cmd || Name
+
| 303 || [[#DeactivateIrsensor]]
 
|-
 
|-
| 0 || [[#Write]]
+
| 304 || [[#GetIrsensorSharedMemoryHandle]]
|}
  −
 
  −
=== Write ===
  −
This is the inverse of [[#IReadSession]] cmd0. Uses the OUTPUT endpoint with an input buffer.
  −
 
  −
= ahid:hdr =
  −
This is "nn::ahid::hdr::ISession".
  −
 
  −
Used internally for USB HID devices.
  −
 
  −
This service no longer exists in [9.0.0+].
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Cmd || Name
+
| 305 || [[#StopImageProcessor]]
 
|-
 
|-
| 0 || GetDeviceEntries
+
| 306 || [[#RunMomentProcessor]]
 
|-
 
|-
| 1 || GetDeviceList
+
| 307 || [[#RunClusteringProcessor]]
 
|-
 
|-
| 2 || GetDeviceParameters
+
| 308 || [[#RunImageTransferProcessor]]
 
|-
 
|-
| 3 || AttachDevice
+
| 309 || [[#GetImageTransferProcessorState]]
 
|-
 
|-
| 4 || DetachDevice
+
| 310 || [[#RunTeraPluginProcessor]]
 
|-
 
|-
| 5 || [6.0.0+] SetDeviceFilter
+
| 311 || [[#GetNpadIrCameraHandle]]
|}
  −
 
  −
= xcd:sys =
  −
This is "nn::xcd::detail::ISystemServer".
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Cmd || Name
+
| 312 || [[#RunPointingProcessor]]
 
|-
 
|-
| 0 || GetDataFormat
+
| 313 || [[#SuspendImageProcessor]]
 
|-
 
|-
| 1 || SetDataFormat
+
| 314 || [3.0.0+] [[#CheckFirmwareVersion]]
 
|-
 
|-
| 2 || GetMcuState
+
| 315 || [4.0.0+] [[#SetFunctionLevel]]
 
|-
 
|-
| 3 || SetMcuState
+
| 316 || [4.0.0+] [[#RunImageTransferExProcessor]]
 
|-
 
|-
| 4 || GetMcuVersionForNfc
+
| 317 || [4.0.0+] [[#RunIrLedProcessor]]
 
|-
 
|-
| 5 || CheckNfcDevicePower
+
| 318 || [4.0.0+] [[#StopImageProcessorAsync]]
 
|-
 
|-
| 6 || [5.0.0+] SetMcuStateImmediate
+
| 319 || [4.0.0+] [[#ActivateIrsensorWithFunctionLevel]]
 +
|}
 +
 
 +
== ActivateIrsensor ==
 +
Takes a PID-descriptor and an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
== DeactivateIrsensor ==
 +
Takes a PID-descriptor and an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
== GetIrsensorSharedMemoryHandle ==
 +
Takes a PID-descriptor and an [[AM_services|AppletResourceUserId]]. Returns a SharedMemory handle.
 +
 
 +
The SharedMemory is "nn::irsensor::detail::StatusManager". It's mapped with permission read-only and size 0x8000.
 +
 
 +
It's structure is as follows:
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 10 || SetNfcEvent
+
! Offset || Size || Description
 
|-
 
|-
| 11 || GetNfcInfo
+
| 0x0 || 0x7FB0 || Array of [[#DeviceFormat]]
 
|-
 
|-
| 12 || StartNfcDiscovery
+
| 0x7FB0 || 0x50 || Array of [[#AruidFormat]]
 +
|}
 +
 
 +
The array of [[#DeviceFormat]] is indexed by [[#IrCameraHandle|PlayerNumber]] and can hold up to 9 entries. The array of [[#AruidFormat]] can only hold up to 5 entries.
 +
 
 +
=== DeviceFormat ===
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 13 || StopNfcDiscovery
+
! Offset || Size || Description
 
|-
 
|-
| 14 || StartNtagRead
+
| 0x0 || 0x4 || [[#IrCameraStatus]]
 
|-
 
|-
| 15 || StartNtagWrite
+
| 0x4 || 0x4 || [[#IrCameraInternalStatus]]
 
|-
 
|-
| 16 || SendNfcRawData
+
| 0x8 || 0x8 || [[#IrSensorMode]]
 
|-
 
|-
| 17 || RegisterMifareKey
+
| 0x10 || 0xE20 || [[#ProcessorStateRingLifo]]
 +
|}
 +
 
 +
==== ProcessorStateRingLifo ====
 +
This is "nn::irsensor::detail::RingLifo<X,Y>" where "X" is a specialized processor state (e.g.: "nn::irsensor::MomentProcessorState") and "Y" is the maximum element count (e.g.: 5).
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 18 || ClearMifareKey
+
! Offset || Size || Description
 
|-
 
|-
| 19 || StartMifareRead
+
| 0x0 || 0x8 || Start
 
|-
 
|-
| 20 || StartMifareWrite
+
| 0x8 || 0x4 || Count
 
|-
 
|-
| 101 || GetAwakeTriggerReasonForLeftRail
+
| 0xC || 0x4 || Padding
 
|-
 
|-
| 102 || GetAwakeTriggerReasonForRightRail
+
| 0x10 || Variable || ProcessorState
 
|}
 
|}
   −
[5.0.0+] SetDataFormat, SetMcuState, and ClearMifareKey: now takes a total of 0xC-bytes of input instead of 0x10.
+
The maximum element count is 6 for [[#PointingProcessorMarkerState]] or 5 for any of the other states.
   −
[6.0.0+]: The buffer type used by GetNfcInfo is now 0x32 instead of 0x1A.
+
ProcessorState is specialized depending on the value of [[#IrSensorMode]].
   −
= hidbus =
+
===== MomentProcessorState =====
This is "nn::hidbus::IHidbusServer".
+
This is "nn::irsensor::MomentProcessorState".
 
  −
This was added with [5.0.0+].
  −
 
  −
Official sw opens a temporary service-session for each func using this, with it being closed once done: no global session is kept open.
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Offset || Size || Description
 
|-
 
|-
| 1 || [[#GetBusHandle]]
+
| 0x0 || 0x8 || SamplingNumber
 
|-
 
|-
| 2 || [[#IsExternalDeviceConnected]]
+
| 0x8 || 0x8 || TimeStamp
 
|-
 
|-
| 3 || [[#Initialize]]
+
| 0x10 || 0x4 || AmbientNoiseLevel
 
|-
 
|-
| 4 || [[#Finalize]]
+
| 0x14 || 0x4 || Reserved
 
|-
 
|-
| 5 || [[#EnableExternalDevice]]
+
| 0x18 || 0x240 || Array of [[#MomentStatistic]]
 +
|}
 +
 
 +
The array of [[#MomentStatistic]] can hold up to 48 entries. This array can be accessed as [y + x*8] (this is a 6x8 array). region_x = image_x/6, region_y = image_y/8.
 +
 
 +
====== MomentStatistic ======
 +
In sdknso GetMomentProcessorStates, this loops through each MomentProcessorState->MomentStatistic entry: <code>AverageIntensity *= scale;</code> The scale is calculated with: <code>scale = 76800.0f / (float)([[#PackedMomentProcessorConfig|WindowOfInterest]].width * [[#PackedMomentProcessorConfig|WindowOfInterest]].height);</code> Note that <code>76800 == 320*240</code>, hence with the default width/height the calculated scale is 1.0f.
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 6 || [[#GetExternalDeviceId]]
+
! Offset || Size || Description
 
|-
 
|-
| 7 || [[#SendCommandAsync]]
+
| 0x0 || 0x4 || float AverageIntensity
 
|-
 
|-
| 8 || [[#GetSendCommandAsynceResult]]
+
| 0x4 || 0x4 || float CentroidX
 
|-
 
|-
| 9 || [[#SetEventForSendCommandAsycResult]]
+
| 0x8 || 0x4 || float CentroidY
 +
|}
 +
 
 +
===== ClusteringProcessorState =====
 +
This is "nn::irsensor::ClusteringProcessorState".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 10 || [[#GetSharedMemoryHandle]]
+
! Offset || Size || Description
 
|-
 
|-
| 11 || [[#EnableJoyPollingReceiveMode]]
+
| 0x0 || 0x8 || SamplingNumber
 
|-
 
|-
| 12 || [[#DisableJoyPollingReceiveMode]]
+
| 0x8 || 0x8 || TimeStamp
 
|-
 
|-
| 13 || [5.0.0-6.2.0] GetPollingData
+
| 0x10 || 0x1 || ObjectCount
 
|-
 
|-
| 14 || [6.0.0+] [[#SetStatusManagerType]]
+
| 0x11 || 0x3 || Reserved
 +
|-
 +
| 0x14 || 0x4 || AmbientNoiseLevel
 +
|-
 +
| 0x18 || 0x180 || Array of [[#ClusteringData]]
 
|}
 
|}
   −
sdknso doesn't use the GetPollingData cmd.
+
The array of [[#ClusteringData]] can hold up to 16 entries.
   −
== GetBusHandle ==
+
====== ClusteringData ======
Takes an input u32 [[#NpadIdType]], an u64 [[#BusType]], an u64 [[AM_services|AppletResourceUserId]], returns an output u8 bool and a [[#BusHandle]].
+
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || float AverageIntensity
 +
|-
 +
| 0x4 || 0x4 || float CentroidX
 +
|-
 +
| 0x8 || 0x4 || float CentroidY
 +
|-
 +
| 0xC || 0x4 || PixelCount
 +
|-
 +
| 0x10 || 0x2 || BoundX
 +
|-
 +
| 0x12 || 0x2 || BoundY
 +
|-
 +
| 0x14 || 0x2 || BoundtWidth
 +
|-
 +
| 0x16 || 0x2 || BoundHeight
 +
|}
   −
The bool indicates whether the [[#BusHandle]] is valid.
+
===== PointingProcessorMarkerState =====
 +
This is "nn::irsensor::PointingProcessorMarkerState".
   −
Official sw will assert when [[#BusHandle]] InternalIndex is >=0x11 (>=0x13 with [6.0.0+]). This same check is also done for all funcs using [[#BusHandle]] as input.
+
{| class="wikitable" border="1"
 
+
|-
This cmd will throw an error when [[#BusType]] is invalid.
+
! Offset || Size || Description
 
+
|-
== IsExternalDeviceConnected ==
+
| 0x0 || 0x8 || SamplingNumber
Takes an input [[#BusHandle]], returns an output u8 bool.
+
|-
 
+
| 0x8 || 0x8 || TimeStamp
This is not used by sdknso.
+
|-
 
+
| 0x10 || 0x1 || PointingStatus
== Initialize ==
+
|-
Takes an input [[#BusHandle]], an u64 [[AM_services|AppletResourceUserId]], no output.
+
| 0x11 || 0x3 || Reserved
 
+
|-
Prior to using this cmd, sdknso handles [[#GetSharedMemoryHandle|sharedmem]] mapping if not done previously.
+
| 0x14 || 0x4 || Unknown
 
+
|-
== Finalize ==
+
| 0x18 || 0x4 || float Unknown
Takes an input [[#BusHandle]], an u64 [[AM_services|AppletResourceUserId]], no output.
+
|-
 
+
| 0x1C || 0x4 || float PositionX
== EnableExternalDevice ==
+
|-
Takes an input u8 bool, a [[#BusHandle]], an u64, an u64 [[AM_services|AppletResourceUserId]], no output.
+
| 0x20 || 0x4 || float PositionY
 
+
|-
sdknso passes value 0x38900050018 (0x3A600050018 with 7.x+) for the u64.
+
| 0x24 || 0x4 || float Unknown
 
+
|-
The bool flag indicates whether to enable the device (true = enable, false = disable).  When false, this will use [[#DisableJoyPollingReceiveMode]] if needed.
+
| 0x28 || 0x2 || WindowOfInterestX
 
+
|-
== GetExternalDeviceId ==
+
| 0x2A || 0x2 || WindowOfInterestY
Takes an input [[#BusHandle]], returns an output u32 ExternalDeviceId.
+
|-
 
+
| 0x2C || 0x2 || WindowOfInterestWidth
== SendCommandAsync ==
+
|-
Takes a type-0x21 input buffer and a [[#BusHandle]], no output.
+
| 0x2E || 0x2 || WindowOfInterestHeight
 
+
|-
== GetSendCommandAsynceResult ==
+
| 0x30 || 0x1 || PointingStatus
Takes a type-0x22 output buffer and a [[#BusHandle]], returns an output u32.
+
|-
 
+
| 0x31 || 0x3 || Reserved
Official sw copies the u32 to an output u64, for the actual output size.
+
|-
 
+
| 0x34 || 0x4 || Unknown
== SetEventForSendCommandAsycResult ==
+
|-
Takes an input [[#BusHandle]], returns an output Event handle with EventClearMode=0.
+
| 0x38 || 0x4 || float Unknown
 
  −
Official sw with SendAndReceive clears this event (6.x+ sdknso), uses [[#SendCommandAsync]], waits on + clears this event, then uses [[#GetSendCommandAsynceResult]].
  −
 
  −
== GetSharedMemoryHandle ==
  −
No input, returns an output SharedMemory handle.
  −
 
  −
The SharedMemory is mapped with size 0x1000 and permissions=R--.
  −
 
  −
See also [[#SetStatusManagerType]].
  −
 
  −
This sharedmem is the StatusManager. This sharedmem contains an array of 0x100-byte (0x80-byte with [[#SetStatusManagerType|[6.0.0+]]]) entries, with entry-count {max [[#GetBusHandle|BusHandles]]}.
  −
 
  −
sdknso only uses the first 0x10-bytes of these entries, the rest is the ignored. Entry structure:
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 0x3C || 0x4 || float PositionX
 
|-
 
|-
| 0x0 || 0x1 || Bool flag
+
| 0x40 || 0x4 || float PositionY
 
|-
 
|-
| 0x1 || 0x3 || Padding
+
| 0x44 || 0x4 || float Unknown
 
|-
 
|-
| 0x4 || 0x4 || Result
+
| 0x48 || 0x2 || WindowOfInterestX
 
|-
 
|-
| 0x8 || 0x1 || DeviceEnabled. Bool flag indicating whether a device is [[#EnableExternalDevice|enabled]].
+
| 0x4A || 0x2 || WindowOfInterestY
 
|-
 
|-
| 0x9 || 0x1 || IsValid. Bool flag indicating whether this entry is valid.
+
| 0x4C || 0x2 || WindowOfInterestWidth
 
|-
 
|-
| 0xA || 0x1 || PollingEnabled. Bool flag indicating whether polling is [[#EnableJoyPollingReceiveMode|enabled]].
+
| 0x4E || 0x2 || WindowOfInterestHeight
 
|-
 
|-
| 0xB || 0x1 || Unknown / padding?
+
| 0x50 || 0x1 || PointingStatus
 +
|-
 +
| 0x51 || 0x3 || Reserved
 +
|-
 +
| 0x54 || 0x4 || Unknown
 +
|-
 +
| 0x58 || 0x4 || float Unknown
 +
|-
 +
| 0x5C || 0x4 || float PositionX
 +
|-
 +
| 0x60 || 0x4 || float PositionY
 +
|-
 +
| 0x64 || 0x4 || float Unknown
 +
|-
 +
| 0x68 || 0x2 || WindowOfInterestX
 +
|-
 +
| 0x6A || 0x2 || WindowOfInterestY
 +
|-
 +
| 0x6C || 0x2 || WindowOfInterestWidth
 
|-
 
|-
| 0xC || 0x4 || [[#JoyPollingMode]]
+
| 0x6E || 0x2 || WindowOfInterestHeight
 
|}
 
|}
   −
== EnableJoyPollingReceiveMode ==
+
===== PointingProcessorState =====
Takes a type-0x21 input buffer, a TransferMemory handle, an u32 tmem_size, an u32 [[#JoyPollingMode]], a [[#BusHandle]], no output.
+
This is "nn::irsensor::PointingProcessorState".
   −
The TransferMemory is created with an user-specified output buffer, with permissions=R--.
+
This is created from [[#PointingProcessorMarkerState]].
 
  −
The content of the TransferMemory depends of the [[#JoyPollingMode]]. This is used by GetJoyPollingReceivedData. Structure of the TransferMemory (DisableSixAxisPollingDataAccessor, EnableSixAxisPollingDataAccessor, JoyButtonOnlyPollingDataAccessor):
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,736: Line 1,780:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x4 || Result.
+
| 0x0 || 0x8 || SamplingNumber
 +
|-
 +
| 0x8 || 0x8 || TimeStamp
 
|-
 
|-
| 0x0 || 0x4 || Padding.
+
| 0x10 || 0x4 || PointingStatus
 
|-
 
|-
| 0x8 || 0x18 || Initialized sysmodule-side, not used by sdknso.
+
| 0x14 || 0x4 || float PositionX
 
|-
 
|-
| 0x20 || 0x8 || Latest entry.
+
| 0x18 || 0x4 || float PositionY
 
|-
 
|-
| 0x28 || 0x8 || Total entries.
+
| 0x1C || 0x4 || Reserved
 
|}
 
|}
   −
The entries specific to the [[#JoyPollingMode]] follow, with 0xA entries total. Each entry starts with an u64 timestamp. Structure for each mode, after the timestamp:
+
===== TeraPluginProcessorState =====
 
+
This is "nn::irsensor::TeraPluginProcessorState".
DisableSixAxisPollingDataAccessor:
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,755: Line 1,800:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x26 || Data
+
| 0x0 || 0x8 || SamplingNumber
 
|-
 
|-
| 0x26 || 0x1 || Size of data.
+
| 0x8 || 0x8 || TimeStamp
 
|-
 
|-
| 0x27 || 0x1 || Padding
+
| 0x10 || 0x4 || AmbientNoiseLevel
 
|-
 
|-
| 0x28 || 0x8 || Timestamp
+
| 0x14 || 0x12C || PluginData
 
|}
 
|}
   −
JoyEnableSixAxisPollingDataAccessor:
+
===== AdaptiveClusteringProcessorState =====
 +
This is "nn::irsensor::AdaptiveClusteringProcessorState".
 +
 
 +
This is created from [[#TeraPluginProcessorState]].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,770: Line 1,818:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x8 || Data
+
| 0x0 || 0x8 || SamplingNumber
 +
|-
 +
| 0x8 || 0x8 || TimeStamp
 +
|-
 +
| 0x10 || 0x4 || AmbientNoiseLevel
 +
|-
 +
| 0x14 || 0x4 || AccuracyLevel
 +
|-
 +
| 0x18 || 0x1 || ObjectCount
 
|-
 
|-
| 0x8 || 0x1 || Size of data.
+
| 0x19 || 0x1 || BackgroundIntensity
 
|-
 
|-
| 0x9 || 0x7 || Padding
+
| 0x1A || 0x6 || Reserved
 
|-
 
|-
| 0x10 || 0x8 || Timestamp
+
| 0x20 || 0x200 || Array of [[#AdaptiveClusteringData]]
 
|}
 
|}
   −
JoyButtonOnlyPollingDataAccessor:
+
The array of [[#AdaptiveClusteringData]] can hold up to 16 entries.
    +
====== AdaptiveClusteringData ======
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x2C || Data
+
| 0x0 || 0x4 || float CentroidX
 
|-
 
|-
| 0x2C || 0x1 || Size of data.
+
| 0x4 || 0x4 || float CentroidY
 
|-
 
|-
| 0x2D || 0x3 || Padding
+
| 0x8 || 0x4 || float Area
 
|-
 
|-
| 0x30 || 0x8 || Timestamp
+
| 0xC || 0x4 || IsIncomplete
 
|}
 
|}
   −
== DisableJoyPollingReceiveMode ==
+
===== HandAnalysisImageState =====
Takes an input [[#BusHandle]], no output.
+
This is "nn::irsensor::HandAnalysisImageState".
 
  −
== SetStatusManagerType ==
  −
Takes an input u32, no output.
     −
This is used by sdknso immediately after mapping [[#GetSharedMemoryHandle|sharedmem]] (before [[#Initialize]]) with hard-coded value 0x2.
+
This is created from [[#TeraPluginProcessorState]].
 
  −
= GyroscopeZeroDriftMode =
  −
This is "nn::hid::GyroscopeZeroDriftMode".
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Value
  −
!  Description
   
|-
 
|-
| 0 || Loose
+
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || SamplingNumber
 +
|-
 +
| 0x8 || 0x4 || AmbientNoiseLevel
 
|-
 
|-
| 1 || Standard
+
| 0xC || 0x960 || Image
 
|-
 
|-
| 2 || Tight
+
| 0x96C || 0x4 || Reserved
 
|}
 
|}
   −
= NpadStyleTag =
+
===== HandAnalysisSilhouetteState =====
This is "nn::hid::NpadStyleTag".
+
This is "nn::irsensor::HandAnalysisSilhouetteState".
 +
 
 +
This is created from [[#TeraPluginProcessorState]].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Bits
  −
!  Description
  −
!  Notes
   
|-
 
|-
| 0
+
! Offset || Size || Description
| NpadFullKey
  −
| Pro Controller
   
|-
 
|-
| 1
+
| 0x0 || 0x8 || SamplingNumber
| NpadHandheld
  −
| Joy-Con controller in handheld mode
   
|-
 
|-
| 2
+
| 0x8 || 0x4 || AmbientNoiseLevel
| NpadJoyDual
  −
| Joy-Con controller in dual mode
   
|-
 
|-
| 3
+
| 0xC || 0x1354 || Unknown
| NpadJoyLeft
+
|}
| Joy-Con left controller in single mode
+
 
 +
===== HandAnalysisSilhouetteStateWithFullFrameShape =====
 +
This is "nn::irsensor::HandAnalysisSilhouetteStateWithFullFrameShape".
 +
 
 +
This is created from [[#TeraPluginProcessorState]].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 4
+
! Offset || Size || Description
| NpadJoyRight
  −
| Joy-Con right controller in single mode
   
|-
 
|-
| 5
+
| 0x0 || 0x8 || SamplingNumber
| NpadGc
  −
| GameCube controller
   
|-
 
|-
| 6
+
| 0x8 || 0x4 || AmbientNoiseLevel
| NpadPalma
  −
| Poké Ball Plus controller
   
|-
 
|-
| 7
+
| 0xC || 0x156C || Unknown
| NpadLark
+
|}
| NES/Famicom controller
+
 
 +
=== AruidFormat ===
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 8
+
! Offset || Size || Description
| NpadHandheldLark
  −
| NES/Famicom controller in handheld mode
   
|-
 
|-
| 9
+
| 0x0 || 0x8 || IrSensorAruid
| NpadLucia
  −
| SNES controller
   
|-
 
|-
| 10-28
+
| 0x8 || 0x8 || IrSensorAruidStatus
| Reserved
  −
|
  −
|-
  −
| 29
  −
| NpadSystemExt
  −
| Generic external controller
  −
|-
  −
| 30
  −
| NpadSystem
  −
| Generic controller
  −
|-
  −
| 31
  −
| Reserved
  −
|
   
|}
 
|}
   −
= NpadIdType =
+
== StopImageProcessor ==
This is "nn::hid::NpadIdType". This is the controller index used in [[HID_Shared_Memory#Controllers|sharedmem]].
+
Takes a PID-descriptor, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. No output.
   −
{| class="wikitable" border="1"
+
== RunMomentProcessor ==
!  Value
+
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], and a [[#PackedMomentProcessorConfig]]. No output.
!  Description
+
 
|-
+
== RunClusteringProcessor ==
| 0x0 || No1
+
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], and a [[#PackedClusteringProcessorConfig]]. No output.
|-
+
 
| 0x1 || No2
+
== RunImageTransferProcessor ==
|-
+
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], a [[#PackedImageTransferProcessorConfig]], an u64 for the TransferMemory's size, and a TransferMemory handle. No output.
| 0x2 || No3
  −
|-
  −
| 0x3 || No4
  −
|-
  −
| 0x4 || No5
  −
|-
  −
| 0x5 || No6
  −
|-
  −
| 0x6 || No7
  −
|-
  −
| 0x7 || No8
  −
|-
  −
| 0x10 || Other
  −
|-
  −
| 0x20 || Handheld
  −
|}
     −
= NpadInterfaceType =
+
The TransferMemory is created with an user specified buffer and permission none.
This is "nn::hid::NpadInterfaceType".
     −
{| class="wikitable" border="1"
+
== GetImageTransferProcessorState ==
!  Value
+
Takes a PID-descriptor, a type-0x6 output buffer, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. Returns an [[#ImageTransferProcessorState]]. No output.
!  Description
  −
|-
  −
| 1 || Bluetooth
  −
|-
  −
| 2 || Rail
  −
|-
  −
| 3 || USB
  −
|-
  −
| 4 || Unknown
  −
|}
     −
= AbstractedPadState =
+
== RunTeraPluginProcessor==
{| class="wikitable" border="1"
+
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedTeraPluginProcessorConfig]] (immediately after the previous word), and an [[AM_services|AppletResourceUserId]]. No output.
|-
  −
! Offset || Size || Description
  −
|-
  −
| 0x0 || 0x4 || Type, only 1 bit can be set. Converted to [[#HdlsDeviceInfo]]::type internally by [[#SetAutoPilotVirtualPadState]].
  −
|-
  −
| 0x4 || 0x1 || Flags. [[#SetAutoPilotVirtualPadState]] only uses bit0: when clear it will skip using the rest of the input and run [[#UnsetAutoPilotVirtualPadState]] internally.
  −
|-
  −
| 0x5 || 0x3 || Padding
  −
|-
  −
| 0x8 || 0x4 || RGBA Single Body Color
  −
|-
  −
| 0xC || 0x4 || RGBA Single Buttons Color
  −
|-
  −
| 0x10 || 0x1 || See [[#HiddbgHdlsDeviceInfo]]::[[#NpadInterfaceType]].
  −
|-
  −
| 0x11 || 0x3 || Padding
  −
|-
  −
| 0x14 || 0x24 || [[#HdlsState]]. Unknown if the last 4-bytes are included in this struct, [[#SetAutoPilotVirtualPadState]]/[[#hiddbgGetAbstractedPadsState]] only uses the first 0x20-bytes.
  −
|-
  −
| 0x38 || 0x60 || Unused with [[#SetAutoPilotVirtualPadState]]/[[#GetAbstractedPadsState]].
  −
|}
     −
Normally the input state is merged with an existing controller selected by Type. However in some cases (BIT(2-5) with type2!=0x2 and BIT(31)) it's detected as a dedicated controller.
+
== GetNpadIrCameraHandle ==
 +
Takes an input [[#NpadIdType]]. Returns an output [[#IrCameraHandle]].
 +
 
 +
== RunPointingProcessor ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedPointingProcessorConfig]] (immediately after the previous word), and an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
== SuspendImageProcessor ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
sdknso uses this from the Run*Processor funcs to suspend the current Processor when the current [[#PackedFunctionLevel|FunctionLevel]] is >= 0x1, prior to starting another Processor if needed (depending on  what Processor was already active via a state field). Hence, this cmd is only used with [4.0.0+].
 +
 
 +
== CheckFirmwareVersion ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedMcuVersion]], and an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
sdknso didn't actually use this until 4.x (the RequiredMcuVersion was also updated with that version).
 +
 
 +
== SetFunctionLevel ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedFunctionLevel]], and an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
== RunImageTransferExProcessor ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], a [[#PackedImageTransferProcessorExConfig]], an u64 for the TransferMemory's size, and a TransferMemory handle. No output.
 +
 
 +
The TransferMemory is created with an user specified buffer and permission none.
 +
 
 +
== RunIrLedProcessor ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedIrLedProcessorConfig]] (immediately after the previous word), and an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
== StopImageProcessorAsync ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
== ActivateIrsensorWithFunctionLevel ==
 +
Takes a PID-descriptor, an [[#PackedFunctionLevel]], and an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
= irs:sys =
 +
This is "nn::irsensor::IIrSensorSystemServer".
   −
Type:
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Bits
  −
!  [[#HdlsDeviceInfo]]::type bits
  −
!  Description
  −
!  Notes
   
|-
 
|-
| 0 || 0 || ||  
+
! Cmd || Name
 
|-
 
|-
| 1 || 15 || || [[#DeviceType]] |= BIT(1)
+
| 500 || [[#SetAppletResourceUserId]]
 
|-
 
|-
| 2 || 1 || ||  
+
| 501 || [[#RegisterAppletResourceUserId]]
 
|-
 
|-
| 3 || 2 || ||  
+
| 502 || [[#UnregisterAppletResourceUserId]]
 
|-
 
|-
| 4 || 1 || ||  
+
| 503 || [[#EnableAppletToGetInput]]
 +
|}
 +
 
 +
== SetAppletResourceUserId ==
 +
Takes an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
== RegisterAppletResourceUserId ==
 +
Takes a bool and an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
== UnregisterAppletResourceUserId ==
 +
Takes an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
== EnableAppletToGetInput ==
 +
Takes a bool and an [[AM_services|AppletResourceUserId]]. No output.
 +
 
 +
= ahid:cd =
 +
This is "nn::ahid::IServerSession".
 +
 
 +
Used for USB HID devices.
 +
 
 +
This service no longer exists in [9.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 5 || 2 || ||  
+
! Cmd || Name
 
|-
 
|-
| 6 || 3 || ||  
+
| 0 || [[#AcquireDevice]]
 
|-
 
|-
| 7 || 11 || || [[#DeviceType]] |= BIT(11)
+
| 1 || [[#ReleaseDevice]]
 
|-
 
|-
| 8 || 12 || || [[#DeviceType]] |= BIT(12)
+
| 2 || [[#GetCtrlSession]]
 
|-
 
|-
| 9 || 13 || || [[#DeviceType]] |= BIT(13)
+
| 3 || [[#GetReadSession]]
|-
  −
| 10 || 14 || || [[#DeviceType]] |= BIT(14)
  −
|-
  −
| 11 || 15 || || [[#DeviceType]] |= BIT(11)
  −
|-
  −
| 12 || 12 || || [[#DeviceType]] |= BIT(12)
  −
|-
  −
| 13 || 13 || || [[#DeviceType]] |= BIT(13)
  −
|-
  −
| 14 || 14 || || [[#DeviceType]] |= BIT(14)
  −
|-
  −
| 15 || 17 || ||
  −
|-
  −
| 31 || 21 || || [[#DeviceType]] = BIT(31)
   
|-
 
|-
 +
| 4 || [1.0.0-2.3.0] [[#GetWriteSession]]
 
|}
 
|}
   −
The above "[[#DeviceType]] |=" notes only apply when type2 is 0x2.
+
== AcquireDevice ==
 +
Takes an input s32, no output.
   −
= HdlsNpadAssignment =
+
== ReleaseDevice ==
This is a 0x208-byte struct.
+
Takes an input s32, no output.
   −
{| class="wikitable" border="1"
+
== GetCtrlSession ==
|-
+
Takes an input u32, returns an [[#ICtrlSession]].
! Offset || Size || Description
+
 
|-
+
== GetReadSession ==
| 0x0 || 0x4 || s32 Total entries
+
Takes an input u32, returns an [[#IReadSession]].
|-
+
 
| 0x4 || 0x4 || Padding
+
== GetWriteSession ==
|-
+
Takes an input u32, returns an [[#IWriteSession]].
| 0x8 || 0x200(0x20*0x10) || Array of [[#HdlsNpadAssignmentEntry]].
+
 
|}
+
== ICtrlSession ==
 +
This is "nn::ahid::ICtrlSession".
   −
= HdlsNpadAssignmentEntry =
+
This no longer exists in [9.0.0+].
This is a 0x20-byte struct.
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Description
+
! Cmd || Name
 +
|-
 +
| 0 || GetString
 
|-
 
|-
| 0x0 || 0x8 || HdlsHandle
+
| 1 || GetCodeBook
 
|-
 
|-
| 0x8 || 0x4 || ?
+
| 2 || GetReport
 
|-
 
|-
| 0xC || 0x4 || ?
+
| 3 || SetReport
 
|-
 
|-
| 0x10 || 0x8 || ?
+
| 4 || GetIdle
 
|-
 
|-
| 0x18 || 0x1 || ?
+
| 5 || SetIdle
 
|-
 
|-
| 0x19 || 0x7 || Padding
+
| 6 || GetProtocol
|}
+
|-
 
+
| 7 || SetProtocol
= HdlsStateList =
+
|-
This is a 0x408-byte struct.
+
| 8 || GetDescriptor
 
  −
[9.0.0+] This is a 0x488-byte struct.
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 9 || SetDescriptor
 
|-
 
|-
| 0x0 || 0x4 || s32 Total entries
+
| 10 || GetStateChangeEvent
 
|-
 
|-
| 0x4 || 0x4 || Padding
+
| 11 || SignalStateChangeEvent
 
|-
 
|-
| 0x8 || <[[#HdlsStateListEntry]] size>*0x10 || Array of [[#HdlsStateListEntry]].
+
| 12 || [3.0.0+] Write
 
|}
 
|}
   −
This contains a list of all controllers, including non-virtual controllers.
+
All of these use USB [[USB_services|CtrlXfer]], except for GetStateChangeEvent and SignalStateChangeEvent, and GetCodeBook which copies 0x4000-bytes from state to output.
   −
= HdlsStateListEntry =
+
== IReadSession ==
This is a 0x40-byte struct.  
+
This is "nn::ahid::IReadSession".
   −
[9.0.0+] This is a 0x48-byte struct.
+
This no longer exists in [9.0.0+].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Description
+
! Cmd || Name
 
|-
 
|-
| 0x0 || 0x8 || HdlsHandle
+
| 0 || [[#Read]]
|-
+
|}
| 0x8 || [[#HdlsDeviceInfo]] size || [[#HdlsDeviceInfo]]. With [[#ApplyHdlsStateList]] this is only used when creating new devices.
+
 
 +
=== 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+] Now takes a total of 8-bytes of input.
 +
 
 +
== IWriteSession ==
 +
This is "nn::ahid::IWriteSession".
 +
 
 +
This was removed with [3.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x8 + [[#HdlsDeviceInfo]] size, with 8-byte alignment || 0x24 || [[#HdlsState]]
+
! Cmd || Name
 
|-
 
|-
| <Immediately following the above> || 0x4 || Padding
+
| 0 || [[#Write]]
 
|}
 
|}
   −
= HdlsDeviceInfo =
+
=== Write ===
This is a 0x10-byte struct.
+
This is the inverse of [[#IReadSession]] cmd0. Uses the OUTPUT endpoint with an input buffer.
 +
 
 +
= ahid:hdr =
 +
This is "nn::ahid::hdr::ISession".
 +
 
 +
Used internally for USB HID devices.
 +
 
 +
This service no longer exists in [9.0.0+].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Description
+
! Cmd || Name
 
|-
 
|-
| 0x0 || 0x4 || [[#DeviceTypeInternal]]
+
| 0 || GetDeviceEntries
 
|-
 
|-
| 0x4 || 0x4 || RGBA Single Body Color
+
| 1 || GetDeviceList
 
|-
 
|-
| 0x8 || 0x4 || RGBA Single Buttons Color
+
| 2 || GetDeviceParameters
 
|-
 
|-
| 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.
+
| 3 || AttachDevice
 
|-
 
|-
| 0xD || 0x3 || Padding
+
| 4 || DetachDevice
 +
|-
 +
| 5 || [6.0.0+] SetDeviceFilter
 
|}
 
|}
   −
[9.0.0+] This is a 0x14-byte struct.
+
= xcd:sys =
 +
This is "nn::xcd::detail::ISystemServer".
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Description
+
! Cmd || Name
 
|-
 
|-
| 0x0 || 0x1 || [[#DeviceTypeInternal]]
+
| 0 || GetDataFormat
 
|-
 
|-
| 0x1 || 0x1 || [[#NpadInterfaceType]]. Similar to the field from the old struct.
+
| 1 || SetDataFormat
 
|-
 
|-
| 0x2 || 0x2 || Padding
+
| 2 || GetMcuState
 
|-
 
|-
| 0x4 || 0x4 || RGBA Single Body Color
+
| 3 || SetMcuState
 
|-
 
|-
| 0x8 || 0x4 || RGBA Single Buttons Color
+
| 4 || GetMcuVersionForNfc
 
|-
 
|-
| 0xC || 0x4 || RGBA Unknown Body Color
+
| 5 || CheckNfcDevicePower
 
|-
 
|-
| 0x10 || 0x4 || RGBA Unknown Buttons Color
+
| 6 || [5.0.0+] SetMcuStateImmediate
|}
  −
 
  −
= DeviceTypeInternal =
  −
This is "nn::hid::detail::DeviceTypeInternal".
  −
 
  −
{| class="wikitable" border="1"
  −
!  Bits
  −
!  Description
   
|-
 
|-
| 0-7
+
| 10 || SetNfcEvent
| 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
+
| 11 || GetNfcInfo
| Pro Controller
+
|-
 +
| 12 || StartNfcDiscovery
 +
|-
 +
| 13 || StopNfcDiscovery
 +
|-
 +
| 14 || StartNtagRead
 +
|-
 +
| 15 || StartNtagWrite
 +
|-
 +
| 16 || SendNfcRawData
 
|-
 
|-
| 11
+
| 17 || RegisterMifareKey
| Famicom left controller
   
|-
 
|-
| 12
+
| 18 || ClearMifareKey
| Famicom right controller (with microphone)
   
|-
 
|-
| 13
+
| 19 || StartMifareRead
| NES left controller
   
|-
 
|-
| 14
+
| 20 || StartMifareWrite
| NES right controller
   
|-
 
|-
| 15-16
+
| 101 || GetAwakeTriggerReasonForLeftRail
| Invalid
   
|-
 
|-
| 17
+
| 102 || GetAwakeTriggerReasonForRightRail
| Generic external controller
   
|-
 
|-
| 18-20
+
| 103 || [10.0.0+] GetAwakeTriggerBatteryLevelTransitionForLeftRail
| Invalid
   
|-
 
|-
| 21-23
+
| 104 || [10.0.0+] GetAwakeTriggerBatteryLevelTransitionForRightRail
| Generic controller
   
|}
 
|}
   −
[9.0.0+] This is "nn::hidtypes::DeviceType".
+
[5.0.0+] SetDataFormat, SetMcuState, and ClearMifareKey: now takes a total of 0xC-bytes of input instead of 0x10.
 +
 
 +
[6.0.0+]: The buffer type used by GetNfcInfo is now 0x32 instead of 0x1A.
 +
 
 +
= hidbus =
 +
This is "nn::hidbus::IHidbusServer".
 +
 
 +
This was added with [5.0.0+].
 +
 
 +
Official sw opens a temporary service-session for each func using this, with it being closed once done: no global session is kept open.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Value
  −
!  [[#DeviceType|DeviceType]]
  −
!  [[#UniquePadType|UniquePadType]]
  −
!  Description
   
|-
 
|-
| 1 || JoyRight, HandheldRight || JoyRight || Joy-Con right controller
+
! Cmd || Name
 
|-
 
|-
| 2 || JoyLeft, HandheldLeft || JoyLeft || Joy-Con left controller
+
| 1 || [[#GetBusHandle]]
 
|-
 
|-
| 3 || FullKey || FullKey || Pro Controller
+
| 2 || [[#IsExternalDeviceConnected]]
 
|-
 
|-
| 4 || JoyLeft || JoyLeft || Reserved
+
| 3 || [[#Initialize]]
 
|-
 
|-
| 5 || JoyRight || JoyRight || Reserved
+
| 4 || [[#Finalize]]
 
|-
 
|-
| 6 || FullKey || FullKey || Reserved
+
| 5 || [[#EnableExternalDevice]]
 
|-
 
|-
| 7 || LarkHvcLeft, HandheldLarkHvcLeft || JoyLeft || Famicom left controller
+
| 6 || [[#GetExternalDeviceId]]
 
|-
 
|-
| 8 || LarkHvcRight, HandheldLarkHvcRight || JoyRight || Famicom right controller (with microphone)
+
| 7 || [[#SendCommandAsync]]
 
|-
 
|-
| 9 || LarkNesLeft, HandheldLarkNesLeft || JoyLeft || NES left controller
+
| 8 || [[#GetSendCommandAsynceResult]]
 
|-
 
|-
| 10 || LarkNesRight, HandheldLarkNesRight || JoyRight || NES right controller
+
| 9 || [[#SetEventForSendCommandAsycResult]]
 
|-
 
|-
| 11 || Lucia || FullKey || SNES controller
+
| 10 || [[#GetSharedMemoryHandle]]
 
|-
 
|-
| 12 || Palma || Other || Poké Ball Plus controller
+
| 11 || [[#EnableJoyPollingReceiveMode]]
 
|-
 
|-
| 13 || FullKey || FullKey || Gc controller
+
| 12 || [[#DisableJoyPollingReceiveMode]]
 
|-
 
|-
| 14 || HandheldLeft || JoyLeft || Reserved
+
| 13 || [5.0.0-6.2.0] GetPollingData
 
|-
 
|-
| 15 || FullKey || FullKey || Reserved
+
| 14 || [6.0.0+] [[#SetStatusManagerType]]
|-
  −
| 16 || FullKey || FullKey || Reserved
  −
|-
  −
| 17 || DebugPad || DebugPad || Debug controller
  −
|-
  −
| 18 || HandheldRight || JoyRight || Reserved
  −
|-
  −
| 19 || System || Other || Unknown (has [[#NpadStyleTag|NpadFullKey]] style tag)
  −
|-
  −
| 20 || System || Other || Unknown (has [[#NpadStyleTag|NpadJoyDual]] style tag)
  −
|-
  −
| 21 || System || Other || Unknown (has [[#NpadStyleTag|NpadJoyDual]] style tag)
   
|}
 
|}
   −
= HdlsState =
+
sdknso doesn't use the GetPollingData cmd.
This is a 0x24-byte struct.
+
 
 +
== GetBusHandle ==
 +
Takes an input u32 [[#NpadIdType]], an u64 [[#BusType]], an u64 [[AM_services|AppletResourceUserId]], returns an output u8 bool and a [[#BusHandle]].
 +
 
 +
The bool indicates whether the [[#BusHandle]] is valid.
 +
 
 +
Official sw will assert when [[#BusHandle]] InternalIndex is >=0x11 (>=0x13 with [6.0.0+]). This same check is also done for all funcs using [[#BusHandle]] as input.
   −
{| class="wikitable" border="1"
+
This cmd will throw an error when [[#BusType]] is invalid.
|-
+
 
! Offset || Size || Description
+
== IsExternalDeviceConnected ==
|-
+
Takes an input [[#BusHandle]], returns an output u8 bool.
| 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+]:
+
This is not used by sdknso.
{| 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
  −
|}
     −
= NotificationLedPattern =
+
== Initialize ==
{| class="wikitable" border="1"
+
Takes an input [[#BusHandle]], an u64 [[AM_services|AppletResourceUserId]], no output.
|-
+
 
! Offset || Size || Subcommand argdata bytepos || Subcommand argdata nibble || Description
+
Prior to using this cmd, sdknso handles [[#GetSharedMemoryHandle|sharedmem]] mapping if not done previously.
|-
+
 
| 0x0 || 0x1 || 0x0 || Low || Mini Cycle Base Duration. Value 0x1-0xF: 12.5ms - 187.5ms. Value 0x0 = 0ms/OFF.
+
== Finalize ==
|-
+
Takes an input [[#BusHandle]], an u64 [[AM_services|AppletResourceUserId]], no output.
| 0x1 || 0x1 || 0x0 || High || Number of Mini Cycles + 1. Value 0x0-0xF: 1 - 16 mini cycles.
+
 
|-
+
== EnableExternalDevice ==
| 0x2 || 0x1 || 0x1 || Low || Number of Full Cycles. Value 0x1-0xF: 1 - 15 full cycles. Value 0x0 is repeat forever, but if Mini Cycle Base Duration is set to 0x0, it does the 1st Mini Cycle with a 12.5ms base duration and then the LED stays on with LED Start Intensity.
+
Takes an input u8 bool, a [[#BusHandle]], an u64, an u64 [[AM_services|AppletResourceUserId]], no output.
|-
+
 
| 0x3 || 0x1 || 0x1 || High || LED Start Intensity. Value 0x0-0xF: 0% - 100%. (In HW, 1 - 241 duty)
+
sdknso passes value 0x38900050018 (0x3A600050018 with 7.x+) for the u64.
|-
+
 
| 0x4 || 0x1 || 0x2 || High || Mini Cycle 1 LED Intensity. Value 0x0-0xF: 0% - 100%. (In HW, 1 - 241 duty)
+
The bool flag indicates whether to enable the device (true = enable, false = disable). When false, this will use [[#DisableJoyPollingReceiveMode]] if needed.
|-
+
 
| 0x5 || 0x1 || 0x3 || High || Fading Transition Steps to Mini Cycle 1 (Uses PWM). Value 0x0: Instant. Each step duration is based on Mini Cycle Step Duration Multiplier.
+
== GetExternalDeviceId ==
|-
+
Takes an input [[#BusHandle]], returns an output u32 ExternalDeviceId.
| 0x6 || 0x1 || 0x3 || Low || Final Step Duration Multiplier of Mini Cycle 1. Value is a Multiplier of Mini Cycle Base Duration. Value 0x0: 12.5ms, 0x1 - xF: 1x - 15x.
+
 
|-
+
== SendCommandAsync ==
| 0x7 || 0x1 || || || Unused
+
Takes a type-0x21 input buffer and a [[#BusHandle]], no output.
 +
 
 +
== GetSendCommandAsynceResult ==
 +
Takes a type-0x22 output buffer and a [[#BusHandle]], returns an output u32.
 +
 
 +
Official sw copies the u32 to an output u64, for the actual output size.
 +
 
 +
== SetEventForSendCommandAsycResult ==
 +
Takes an input [[#BusHandle]], returns an output Event handle with EventClearMode=0.
 +
 
 +
Official sw with SendAndReceive clears this event (6.x+ sdknso), uses [[#SendCommandAsync]], waits on + clears this event, then uses [[#GetSendCommandAsynceResult]].
 +
 
 +
== GetSharedMemoryHandle ==
 +
No input, returns an output SharedMemory handle.
 +
 
 +
The SharedMemory is mapped with size 0x1000 and permissions=R--.
 +
 
 +
See also [[#SetStatusManagerType]].
 +
 
 +
This sharedmem is the StatusManager. This sharedmem contains an array of 0x100-byte (0x80-byte with [[#SetStatusManagerType|[6.0.0+]]]) entries, with entry-count {max [[#GetBusHandle|BusHandles]]}.
 +
 
 +
sdknso only uses the first 0x10-bytes of these entries, the rest is the ignored. Entry structure:
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x8 || 0x1 || 0x2 || Low || Mini Cycle 2 LED Intensity.
+
! Offset || Size || Description
 
|-
 
|-
| 0x9 || 0x1 || 0x4 || High || Fading Transition Steps to Mini Cycle 2 (see above).
+
| 0x0 || 0x1 || Bool flag
 
|-
 
|-
| 0xA || 0x1 || 0x4 || Low || Final Step Duration Multiplier of Mini Cycle 2 (see above).
+
| 0x1 || 0x3 || Padding
 
|-
 
|-
| 0xB || 0x1 || || || Unused
+
| 0x4 || 0x4 || Result
 
|-
 
|-
| 0xC || 0x1 || 0x5 || High || Mini Cycle 3 LED Intensity.
+
| 0x8 || 0x1 || DeviceEnabled. Bool flag indicating whether a device is [[#EnableExternalDevice|enabled]].
 
|-
 
|-
| 0xD || 0x1 || 0x6 || High || Fading Transition Steps to Mini Cycle 3 (see above).
+
| 0x9 || 0x1 || IsValid. Bool flag indicating whether this entry is valid.
 
|-
 
|-
| 0xE || 0x1 || 0x6 || Low || Final Step Duration Multiplier of Mini Cycle 3 (see above).
+
| 0xA || 0x1 || PollingEnabled. Bool flag indicating whether polling is [[#EnableJoyPollingReceiveMode|enabled]].
 
|-
 
|-
| 0xF || 0x1 || || || Unused
+
| 0xB || 0x1 || Unknown / padding?
 
|-
 
|-
| 0x10 || 0x1 || 0x5 || Low || Mini Cycle 4 LED Intensity.
+
| 0xC || 0x4 || [[#JoyPollingMode]]
 +
|}
 +
 
 +
== EnableJoyPollingReceiveMode ==
 +
Takes a type-0x21 input buffer, a TransferMemory handle, an u32 tmem_size, an u32 [[#JoyPollingMode]], a [[#BusHandle]], no output.
 +
 
 +
The TransferMemory is created with an user-specified output buffer, with permissions=R--.
 +
 
 +
The content of the TransferMemory depends of the [[#JoyPollingMode]]. This is used by GetJoyPollingReceivedData. Structure of the TransferMemory (DisableSixAxisPollingDataAccessor, EnableSixAxisPollingDataAccessor, JoyButtonOnlyPollingDataAccessor):
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x11 || 0x1 || 0x7 || High || Fading Transition Duration to Mini Cycle 4 (see above).
+
! Offset || Size || Description
 
|-
 
|-
| 0x12 || 0x1 || 0x7 || Low || Final Step Duration Multiplier of Mini Cycle 4 (see above).
+
| 0x0 || 0x4 || Result.
 
|-
 
|-
| 0x13 || 0x1 || || || Unused
+
| 0x0 || 0x4 || Padding.
 
|-
 
|-
| 0x14 || 0x1 || 0x8 || High || Mini Cycle 5 LED Intensity.
+
| 0x8 || 0x18 || Initialized sysmodule-side, not used by sdknso.
 
|-
 
|-
| 0x15 || 0x1 || 0x9 || High || Fading Transition Steps to Mini Cycle 5 (see above).
+
| 0x20 || 0x8 || Latest entry.
 
|-
 
|-
| 0x16 || 0x1 || 0x9 || Low || Final Step Duration Multiplier of Mini Cycle 5 (see above).
+
| 0x28 || 0x8 || Total entries.
 +
|}
 +
 
 +
The entries specific to the [[#JoyPollingMode]] follow, with 0xA entries total. Each entry starts with an u64 timestamp. Structure for each mode, after the timestamp:
 +
 
 +
DisableSixAxisPollingDataAccessor:
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x17 || 0x1 || || || Unused
+
! Offset || Size || Description
 
|-
 
|-
| 0x18 || 0x1 || 0x8 || Low || Mini Cycle 6 LED Intensity.
+
| 0x0 || 0x26 || Data
 
|-
 
|-
| 0x19 || 0x1 || 0xA || High || Fading Transition Steps to Mini Cycle 6 (see above).
+
| 0x26 || 0x1 || Size of data.
 
|-
 
|-
| 0x1A || 0x1 || 0xA || Low || Final Step Duration Multiplier of Mini Cycle 6 (see above).
+
| 0x27 || 0x1 || Padding
 
|-
 
|-
| 0x1B || 0x1 || || || Unused
+
| 0x28 || 0x8 || Timestamp
 +
|}
 +
 
 +
JoyEnableSixAxisPollingDataAccessor:
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x1C || 0x1 || 0xB || High || Mini Cycle 7 LED Intensity.
+
! Offset || Size || Description
 
|-
 
|-
| 0x1D || 0x1 || 0xC || High || Fading Transition Steps  to Mini Cycle 7 (see above).
+
| 0x0 || 0x8 || Data
 
|-
 
|-
| 0x1E || 0x1 || 0xC || Low || Final Step Duration Multiplier of Mini Cycle 7 (see above).
+
| 0x8 || 0x1 || Size of data.
 
|-
 
|-
| 0x1F || 0x1 || || || Unused
+
| 0x9 || 0x7 || Padding
 
|-
 
|-
| 0x20 || 0x1 || 0xB || Low || Mini Cycle 8 LED Intensity.
+
| 0x10 || 0x8 || Timestamp
 +
|}
 +
 
 +
JoyButtonOnlyPollingDataAccessor:
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x21 || 0x1 || 0xD || Low || Fading Transition Steps to Mini Cycle 8 (see above).
+
! Offset || Size || Description
 
|-
 
|-
| 0x22 || 0x1 || 0xD || High || Final Step Duration Multiplier of Mini Cycle 8 (see above).
+
| 0x0 || 0x2C || Data
 
|-
 
|-
| 0x23 || 0x1 || || || Unused
+
| 0x2C || 0x1 || Size of data.
 
|-
 
|-
| 0x24 || 0x1 || 0xE || High || Mini Cycle 9 LED Intensity.
+
| 0x2D || 0x3 || Padding
 
|-
 
|-
| 0x25 || 0x1 || 0xF || High || Fading Transition Steps to Mini Cycle 9 (see above).
+
| 0x30 || 0x8 || Timestamp
 +
|}
 +
 
 +
== DisableJoyPollingReceiveMode ==
 +
Takes an input [[#BusHandle]], no output.
 +
 
 +
== SetStatusManagerType ==
 +
Takes an input u32, no output.
 +
 
 +
This is used by sdknso immediately after mapping [[#GetSharedMemoryHandle|sharedmem]] (before [[#Initialize]]) with hard-coded value 0x2.
 +
 
 +
= GyroscopeZeroDriftMode =
 +
This is "nn::hid::GyroscopeZeroDriftMode".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 
|-
 
|-
| 0x26 || 0x1 || 0xF || Low || Final Step Duration Multiplier of Mini Cycle 9 (see above).
+
| 0 || Loose
 
|-
 
|-
| 0x27 || 0x1 || || || Unused
+
| 1 || Standard
 
|-
 
|-
| 0x28 || 0x1 || 0xE || Low || Mini Cycle 10 LED Intensity.
+
| 2 || Tight
 +
|}
 +
 
 +
= NpadStyleTag =
 +
This is "nn::hid::NpadStyleTag".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Bits
 +
!  Description
 +
!  Notes
 
|-
 
|-
| 0x29 || 0x1 || 0x10 || High || Fading Transition Steps to Mini Cycle 10 (see above).
+
| 0
 +
| NpadFullKey
 +
| Pro Controller
 
|-
 
|-
| 0x2A || 0x1 || 0x10 || Low || Final Step Duration Multiplier of Mini Cycle 10 (see above).
+
| 1
 +
| NpadHandheld
 +
| Joy-Con controller in handheld mode
 
|-
 
|-
| 0x2B || 0x1 || || || Unused
+
| 2
 +
| NpadJoyDual
 +
| Joy-Con controller in dual mode
 
|-
 
|-
| 0x2C || 0x1 || 0x11 || High || Mini Cycle 11 LED Intensity.
+
| 3
 +
| NpadJoyLeft
 +
| Joy-Con left controller in single mode
 
|-
 
|-
| 0x2D || 0x1 || 0x12 || High || Fading Transition Steps to Mini Cycle 11 (see above).
+
| 4
 +
| NpadJoyRight
 +
| Joy-Con right controller in single mode
 
|-
 
|-
| 0x2E || 0x1 || 0x12 || Low || Final Step Duration Multiplier of Mini Cycle 11 (see above).
+
| 5
 +
| NpadGc
 +
| GameCube controller
 
|-
 
|-
| 0x2F || 0x1 || || || Unused
+
| 6
 +
| NpadPalma
 +
| Poké Ball Plus controller
 
|-
 
|-
| 0x30 || 0x1 || 0x11 || Low || Mini Cycle 12 LED Intensity.
+
| 7
 +
| NpadLark
 +
| NES/Famicom controller
 
|-
 
|-
| 0x31 || 0x1 || 0x13 || High || Fading Transition Steps to Mini Cycle 12 (see above).
+
| 8
 +
| NpadHandheldLark
 +
| NES/Famicom controller in handheld mode
 
|-
 
|-
| 0x32 || 0x1 || 0x13 || Low || Final Step Duration Multiplier of Mini Cycle 12 (see above).
+
| 9
 +
| NpadLucia
 +
| SNES controller
 
|-
 
|-
| 0x33 || 0x1 || || || Unused
+
| 10-28
 +
| Reserved
 +
|
 
|-
 
|-
| 0x34 || 0x1 || 0x14 || High || Mini Cycle 13 LED Intensity.
+
| 29
 +
| NpadSystemExt
 +
| Generic external controller
 
|-
 
|-
| 0x35 || 0x1 || 0x15 || High || Fading Transition Steps to Mini Cycle 13 (see above).
+
| 30
 +
| NpadSystem
 +
| Generic controller
 
|-
 
|-
| 0x36 || 0x1 || 0x15 || Low || Final Step Duration Multiplier of Mini Cycle 13 (see above).
+
| 31
 +
| Reserved
 +
|
 +
|}
 +
 
 +
= NpadIdType =
 +
This is "nn::hid::NpadIdType". This is the controller index used in [[HID_Shared_Memory#Controllers|sharedmem]].
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 
|-
 
|-
| 0x37 || 0x1 || || || Unused
+
| 0x0 || No1
 
|-
 
|-
| 0x38 || 0x1 || 0x14 || Low || Mini Cycle 14 LED Intensity.
+
| 0x1 || No2
 
|-
 
|-
| 0x39 || 0x1 || 0x16 || High || Fading Transition Steps to Mini Cycle 14 (see above).
+
| 0x2 || No3
 
|-
 
|-
| 0x3A || 0x1 || 0x16 || Low || Final Step Duration Multiplier of Mini Cycle 14 (see above).
+
| 0x3 || No4
 
|-
 
|-
| 0x3B || 0x1 || || || Unused
+
| 0x4 || No5
 
|-
 
|-
| 0x3C || 0x1 || 0x17 || High || Mini Cycle 15 LED Intensity.
+
| 0x5 || No6
 
|-
 
|-
| 0x3D || 0x1 || 0x18 || High || Fading Transition Steps to Mini Cycle 15 (see above).
+
| 0x6 || No7
 
|-
 
|-
| 0x3E || 0x1 || 0x18 || Low || Final Step Duration Multiplier of Mini Cycle 15 (see above).
+
| 0x7 || No8
 
|-
 
|-
| 0x3F || 0x1 || || || Unused
+
| 0x10 || Other
 
|-
 
|-
| 0x40 || 0x1 || 0x17 || Low || Mini Cycle 16 LED Intensity.
+
| 0x20 || Handheld
 +
|}
 +
 
 +
= NpadInterfaceType =
 +
This is "nn::hid::NpadInterfaceType".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 
|-
 
|-
| 0x41 || 0x1 || 0x19 || High || Fading Transition Steps to Mini Cycle 16 (see above). (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
+
| 1 || Bluetooth
 
|-
 
|-
| 0x42 || 0x1 || 0x19 || Low || Final Step Duration Multiplier of Mini Cycle 16 (see above). (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
+
| 2 || Rail
 
|-
 
|-
| 0x43 || 0x1 || || || Unused
+
| 3 || USB
 
|-
 
|-
| 0x44 || 0x1 || 0x1A || High || Unknown (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
+
| 4 || Unknown
 +
|}
 +
 
 +
= AbstractedPadState =
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x45 || 0x1 || 0x1A || Low || Unknown (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
+
! Offset || Size || Description
 
|-
 
|-
| 0x46 || 0x1 || || || Padding
+
| 0x0 || 0x4 || Type, only 1 bit can be set. Converted to [[#HdlsDeviceInfo]]::type internally by [[#SetAutoPilotVirtualPadState]].
 
|-
 
|-
| 0x47 || 0x1 || || || Padding
+
| 0x4 || 0x1 || Flags. [[#SetAutoPilotVirtualPadState]] only uses bit0: when clear it will skip using the rest of the input and run [[#UnsetAutoPilotVirtualPadState]] internally.
 
|-
 
|-
|}
+
| 0x5 || 0x3 || Padding
 
  −
This is "nn::hid::system::NotificationLedPattern".
  −
 
  −
This is a 0x48-byte struct.
  −
 
  −
The above descriptions in the table are based on the info from [https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/bluetooth_hid_subcommands_notes.md here].
  −
 
  −
argdata in the subcommand is initialized as follows: <code>((u8*)cmd_argdata)[pos] = u8_in[pos2] | u8_in[pos3]<<4;</code> Hence, 4bits from pairs of 2-bytes of the input struct are combined to write to the subcommand. Only the low 4bits of each used byte in the struct is used. This is written to stack initially, then copied to the actual cmd_argdata (the data immediately following the subcommandID byte). There's a total of 0x1B-bytes of cmd_argdata initialized from this.
  −
 
  −
The layout of cmd_argdata is as follows:
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 0x8 || 0x4 || RGBA Single Body Color
 
|-
 
|-
| 0x0 || 0x1B || See above.
+
| 0xC || 0x4 || RGBA Single Buttons Color
 
|-
 
|-
| 0x1B || 0xB || Cleared to zero.
+
| 0x10 || 0x1 || See [[#HiddbgHdlsDeviceInfo]]::[[#NpadInterfaceType]].
 
|-
 
|-
| 0x26 || 0x5 || Unused
+
| 0x11 || 0x3 || Padding
 
|-
 
|-
| 0x2B || 0x8 || Set to an input value, which is hard-coded 0.
+
| 0x14 || 0x24 || [[#HdlsState]]. Unknown if the last 4-bytes are included in this struct, [[#SetAutoPilotVirtualPadState]]/[[#hiddbgGetAbstractedPadsState]] only uses the first 0x20-bytes.
 
|-
 
|-
| 0x33 || 0x2 || Set to value 0.
+
| 0x38 || 0x60 || Unused with [[#SetAutoPilotVirtualPadState]]/[[#GetAbstractedPadsState]].
|-
  −
| 0x35 || 0x1 || Set to value 1.
   
|}
 
|}
   −
= DeviceType =
+
Normally the input state is merged with an existing controller selected by Type. However in some cases (BIT(2-5) with type2!=0x2 and BIT(31)) it's detected as a dedicated controller.
This is "nn::hid::system::DeviceType".
      +
Type:
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
!  Bits
 
!  Bits
 +
!  [[#HdlsDeviceInfo]]::type bits
 
!  Description
 
!  Description
 +
!  Notes
 
|-
 
|-
| 0
+
| 0 || 0 || ||
| FullKey
   
|-
 
|-
| 1
+
| 1 || 15 || || [[#DeviceType]] |= BIT(1)
| DebugPad
   
|-
 
|-
| 2
+
| 2 || 1 || ||
| HandheldLeft
   
|-
 
|-
| 3
+
| 3 || 2 || ||
| HandheldRight
   
|-
 
|-
| 4
+
| 4 || 1 || ||
| JoyLeft
   
|-
 
|-
| 5
+
| 5 || 2 || ||
| JoyRight
   
|-
 
|-
| 6
+
| 6 || 3 || ||
| Palma
   
|-
 
|-
| 7
+
| 7 || 11 || || [[#DeviceType]] |= BIT(11)
| LarkHvcLeft
   
|-
 
|-
| 8
+
| 8 || 12 || || [[#DeviceType]] |= BIT(12)
| LarkHvcRight
   
|-
 
|-
| 9
+
| 9 || 13 || || [[#DeviceType]] |= BIT(13)
| LarkNesLeft
   
|-
 
|-
| 10
+
| 10 || 14 || || [[#DeviceType]] |= BIT(14)
| LarkNesRight
   
|-
 
|-
| 11
+
| 11 || 15 || || [[#DeviceType]] |= BIT(11)
| HandheldLarkHvcLeft
   
|-
 
|-
| 12
+
| 12 || 12 || || [[#DeviceType]] |= BIT(12)
| HandheldLarkHvcRight
   
|-
 
|-
| 13
+
| 13 || 13 || || [[#DeviceType]] |= BIT(13)
| HandheldLarkNesLeft
   
|-
 
|-
| 14
+
| 14 || 14 || || [[#DeviceType]] |= BIT(14)
| HandheldLarkNesRight
   
|-
 
|-
| 15
+
| 15 || 17 || ||
| Lucia
   
|-
 
|-
| 16-30
+
| 31 || 21 || || [[#DeviceType]] = BIT(31)
| Reserved
   
|-
 
|-
| 31
  −
| System
   
|}
 
|}
   −
= UniquePadType =
+
The above "[[#DeviceType]] |=" notes only apply when type2 is 0x2.
This is "nn::hid::system::UniquePadType".
+
 
 +
= HdlsNpadAssignment =
 +
This is a 0x208-byte struct.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Value
  −
!  Description
   
|-
 
|-
| 0x0 || Other
+
! Offset || Size || Description
 
|-
 
|-
| 0x1 || FullKey
+
| 0x0 || 0x4 || s32 Total entries
 
|-
 
|-
| 0x2 || JoyRight
+
| 0x4 || 0x4 || Padding
 
|-
 
|-
| 0x3 || JoyLeft
+
| 0x8 || 0x200(0x20*0x10) || Array of [[#HdlsNpadAssignmentEntry]].
|-
  −
| 0x4 || DebugPad
   
|}
 
|}
   −
= IrCameraHandle =
+
= HdlsNpadAssignmentEntry =
This is "nn::irsensor::IrCameraHandle". This is an u32.
+
This is a 0x20-byte struct.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 2,500: Line 2,590:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x1 || PlayerNumber
+
| 0x0 || 0x8 || HdlsHandle
 +
|-
 +
| 0x8 || 0x4 || ?
 +
|-
 +
| 0xC || 0x4 || ?
 +
|-
 +
| 0x10 || 0x8 || ?
 
|-
 
|-
| 0x1 || 0x1 || DeviceType
+
| 0x18 || 0x1 || ?
 
|-
 
|-
| 0x2 || 0x2 || Reserved
+
| 0x19 || 0x7 || Padding
 
|}
 
|}
   −
= IrCameraStatus =
+
= HdlsStateList =
This is "nn::irsensor::IrCameraStatus". This is an u32.
+
This is a 0x408-byte struct.
 +
 
 +
[9.0.0+] This is a 0x488-byte struct.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Value
  −
!  Description
   
|-
 
|-
| 0 || Available
+
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || s32 Total entries
 
|-
 
|-
| 1 || Unsupported
+
| 0x4 || 0x4 || Padding
 
|-
 
|-
| 2 || Unconnected
+
| 0x8 || <[[#HdlsStateListEntry]] size>*0x10 || Array of [[#HdlsStateListEntry]].
 
|}
 
|}
   −
= IrCameraInternalStatus =
+
This contains a list of all controllers, including non-virtual controllers.
This is "nn::irsensor::IrCameraInternalStatus". This is an u32.
+
 
 +
= HdlsStateListEntry =
 +
This is a 0x40-byte struct.
 +
 
 +
[9.0.0+] This is a 0x48-byte struct.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Value
  −
!  Description
   
|-
 
|-
| 0 || Stopped
+
! Offset || Size || Description
 
|-
 
|-
| 1 || FirmwareUpdateNeeded
+
| 0x0 || 0x8 || HdlsHandle
 
|-
 
|-
| 2 ||  
+
| 0x8 || [[#HdlsDeviceInfo]] size || [[#HdlsDeviceInfo]]. With [[#ApplyHdlsStateList]] this is only used when creating new devices.
 
|-
 
|-
| 3 ||  
+
| 0x8 + [[#HdlsDeviceInfo]] size, with 8-byte alignment || 0x24 || [[#HdlsState]]
 
|-
 
|-
| 4 ||  
+
| <Immediately following the above> || 0x4 || Padding
|-
  −
| 5 || FirmwareVersionRequested
  −
|-
  −
| 6 || FirmwareVersionIsInvalid
  −
|-
  −
| 7 || [4.0.0+] Ready
  −
|-
  −
| 8 || [4.0.0+] Setting
   
|}
 
|}
   −
= IrSensorMode =
+
= HdlsDeviceInfo =
This is "nn::irsensor::detail::StatusManager::IrSensorMode". This is an u32.
+
This is a 0x10-byte struct.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Value
  −
!  Description
   
|-
 
|-
| 0 || None
+
! Offset || Size || Description
 
|-
 
|-
| 1 || [[#MomentProcessorState|MomentProcessor]]
+
| 0x0 || 0x4 || [[#DeviceTypeInternal]]
 
|-
 
|-
| 2 || [[#ClusteringProcessorState|ClusteringProcessor]]
+
| 0x4 || 0x4 || RGBA Single Body Color
 
|-
 
|-
| 3 || [[#ImageTransferProcessorState|ImageTransferProcessor]]
+
| 0x8 || 0x4 || RGBA Single Buttons Color
 
|-
 
|-
| 4 || [[#PointingProcessorState|PointingProcessor]]
+
| 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.
 
|-
 
|-
| 5 || [[#TeraPluginProcessorState|TeraPluginProcessor]]
+
| 0xD || 0x3 || Padding
|-
  −
| 6 || Unknown
   
|}
 
|}
   −
= ImageProcessorStatus =
+
[9.0.0+] This is a 0x14-byte struct.
This is "nn::irsensor::ImageProcessorStatus". This is an u32.
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Value
  −
!  Description
   
|-
 
|-
| 0 || Stopped
+
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x1 || [[#DeviceTypeInternal]]
 
|-
 
|-
| 1 || Running
+
| 0x1 || 0x1 || [[#NpadInterfaceType]]. Similar to the field from the old struct.
|}
  −
 
  −
= ImageTransferProcessorFormat =
  −
This is "nn::irsensor::ImageTransferProcessorFormat". This is an u32.
  −
 
  −
This controls the IR Sensor image resolution.
  −
 
  −
{| class="wikitable" border="1"
  −
!  Value
  −
!  Description
   
|-
 
|-
| 0 || 320x240
+
| 0x2 || 0x2 || Padding
 
|-
 
|-
| 1 || 160x120
+
| 0x4 || 0x4 || RGBA Single Body Color
 
|-
 
|-
| 2 || 80x60
+
| 0x8 || 0x4 || RGBA Single Buttons Color
 
|-
 
|-
| 3 || [4.0.0+] 40x30
+
| 0xC || 0x4 || RGBA Unknown Body Color
 
|-
 
|-
| 4 || [4.0.0+] 20x15
+
| 0x10 || 0x4 || RGBA Unknown Buttons Color
 
|}
 
|}
   −
= MomentProcessorConfig =
+
= DeviceTypeInternal =
This is "nn::irsensor::MomentProcessorConfig".
+
This is "nn::hid::detail::DeviceTypeInternal".
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 +
!  Bits
 +
!  Description
 
|-
 
|-
! Offset || Size || Description
+
| 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.
 
|-
 
|-
| 0x0 || 0x8 || ExposureTime (default is 0x493E0)
+
| 8-10
 +
| Pro Controller
 
|-
 
|-
| 0x8 || 0x4 || LightTarget (default is 0)
+
| 11
 +
| Famicom left controller
 
|-
 
|-
| 0xC || 0x4 || Gain (default is 0x8)
+
| 12
 +
| Famicom right controller (with microphone)
 
|-
 
|-
| 0x10 || 0x1 || IsNegativeImageUsed (default is 0)
+
| 13
 +
| NES left controller
 
|-
 
|-
| 0x11 || 0x7 || Reserved
+
| 14
 +
| NES right controller
 
|-
 
|-
| 0x18 || 0x2 || WindowOfInterestX (default is 0)
+
| 15-16
 +
| Invalid
 
|-
 
|-
| 0x1A || 0x2 || WindowOfInterestY (default is 0)
+
| 17
 +
| Generic external controller
 
|-
 
|-
| 0x1C || 0x2 || WindowOfInterestWidth (default is 0x140)
+
| 18-20
 +
| Invalid
 
|-
 
|-
| 0x1E || 0x2 || WindowOfInterestHeight (default is 0xF0)
+
| 21-23
|-
+
| Generic controller
| 0x20 || 0x4 || Preprocess (default is 0x1)
  −
|-
  −
| 0x24 || 0x4 || PreprocessIntensityThreshold (default is 0x50)
   
|}
 
|}
   −
= PackedMomentProcessorConfig =
+
[9.0.0+] This is "nn::hidtypes::DeviceType".
This is "nn::irsensor::PackedMomentProcessorConfig". This is a 0x20-byte struct.  
     −
This is converted from [[#MomentProcessorConfig]].
+
{| class="wikitable" border="1"
 
+
!  Value
{| class="wikitable" border="1"
+
!  [[#DeviceType|DeviceType]]
 +
!  [[#UniquePadType|UniquePadType]]
 +
!  Description
 +
|-
 +
| 1 || JoyRight, HandheldRight || JoyRight || Joy-Con right controller
 
|-
 
|-
! Offset || Size || Description
+
| 2 || JoyLeft, HandheldLeft || JoyLeft || Joy-Con left controller
 
|-
 
|-
| 0x0 || 0x8 || ExposureTime (default is 0x493E0)
+
| 3 || FullKey || FullKey || Pro Controller
 
|-
 
|-
| 0x8 || 0x1 || LightTarget (default is 0)
+
| 4 || JoyLeft || JoyLeft || Reserved
 
|-
 
|-
| 0x9 || 0x1 || Gain (default is 0x8)
+
| 5 || JoyRight || JoyRight || Reserved
 
|-
 
|-
| 0xA || 0x1 || IsNegativeImageUsed (default is 0)
+
| 6 || FullKey || FullKey || Reserved
 
|-
 
|-
| 0xB || 0x5 || Reserved
+
| 7 || LarkHvcLeft, HandheldLarkHvcLeft || JoyLeft || Famicom left controller
 
|-
 
|-
| 0x10 || 0x2 || WindowOfInterestX (default is 0)
+
| 8 || LarkHvcRight, HandheldLarkHvcRight || JoyRight || Famicom right controller (with microphone)
 
|-
 
|-
| 0x12 || 0x2 || WindowOfInterestY (default is 0)
+
| 9 || LarkNesLeft, HandheldLarkNesLeft || JoyLeft || NES left controller
 
|-
 
|-
| 0x14 || 0x2 || WindowOfInterestWidth (default is 0x140)
+
| 10 || LarkNesRight, HandheldLarkNesRight || JoyRight || NES right controller
 
|-
 
|-
| 0x16 || 0x2 || WindowOfInterestHeight (default is 0xF0)
+
| 11 || Lucia || FullKey || SNES controller
 
|-
 
|-
| 0x18 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
+
| 12 || Palma || Other || Poké Ball Plus controller
 
|-
 
|-
| 0x1C || 0x1 || Preprocess (default is 0x1)
+
| 13 || FullKey || FullKey || Gc controller
 
|-
 
|-
| 0x1D || 0x1 || PreprocessIntensityThreshold (default is 0x50)
+
| 14 || HandheldLeft || JoyLeft || Reserved
 
|-
 
|-
| 0x1E || 0x2 || Reserved
+
| 15 || FullKey || FullKey || Reserved
 +
|-
 +
| 16 || FullKey || FullKey || Reserved
 +
|-
 +
| 17 || DebugPad || DebugPad || Debug controller
 +
|-
 +
| 18 || HandheldRight || JoyRight || Reserved
 +
|-
 +
| 19 || System || Other || Unknown (has [[#NpadStyleTag|NpadFullKey]] style tag)
 +
|-
 +
| 20 || System || Other || Unknown (has [[#NpadStyleTag|NpadJoyDual]] style tag)
 +
|-
 +
| 21 || System || Other || Unknown (has [[#NpadStyleTag|NpadJoyDual]] style tag)
 
|}
 
|}
   −
= ClusteringProcessorConfig =
+
= HdlsState =
This is "nn::irsensor::ClusteringProcessorConfig".
+
This is a 0x24-byte struct.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 2,674: Line 2,774:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x8 || ExposureTime (default is 200000)
+
| 0x0 || 0x1 || powerConnected for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
 
|-
 
|-
| 0x8 || 0x4 || LightTarget (default is 0)
+
| 0x1 || 0x1 || ORRed with powerConnected to set the value of the first byte for the controller [[HID_Shared_Memory#Flags|flags]].
 
|-
 
|-
| 0xC || 0x4 || Gain (default is 0x2)
+
| 0x2 || 0x6 || Unknown
 
|-
 
|-
| 0x10 || 0x1 || IsNegativeImageUsed (default is 0)
+
| 0x8 || 0x4 || batteryCharge for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
 
|-
 
|-
| 0x11 || 0x7 || Reserved
+
| 0xC || 0x4 || [[HID_Shared_Memory#Button_State|Buttons]]. Bit18 = HOME and bit19 = Capture.
 
|-
 
|-
| 0x18 || 0x2 || WindowOfInterestX (default is 0)
+
| 0x10 || 0x10(4*2*2) || Joystick data, see [[HID_Shared_Memory#Controller_State]].
 
|-
 
|-
| 0x1A || 0x2 || WindowOfInterestY (default is 0)
+
| 0x20 || 0x1 || Unused for input. Set with output from [[#DumpHdlsStates]] (zero in some cases).
 
|-
 
|-
| 0x1C || 0x2 || WindowOfInterestWidth (default is 320)
+
| 0x21 || 0x3 || Padding
|-
+
|}
| 0x1E || 0x2 || WindowOfInterestHeight (default is 240)
+
 
 +
[9.0.0+]:
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || batteryCharge for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
 +
|-
 +
| 0x4 || 0x4 || Unknown
 
|-
 
|-
| 0x20 || 0x4 || ObjectPixelCountMin (default is 0x3)
+
| 0x8 || 0x8 || [[HID_Shared_Memory#Button_State|Buttons]], masked with 0xfffffffff00fffff. See above table regarding HOME/Capture buttons.
 
|-
 
|-
| 0x24 || 0x4 || ObjectPixelCountMax (default is 0x12C00)
+
| 0x10 || 0x10(4*2*2) || Joystick data, see [[HID_Shared_Memory#Controller_State]].
 
|-
 
|-
| 0x28 || 0x4 || ObjectIntensityMin (default is 150)
+
| 0x20 || 0x1 || Unused for input. Set with output from [[#DumpHdlsStates]] (zero in some cases).
 
|-
 
|-
| 0x2C || 0x1 || IsExternalLightFilterEnabled (default is 0x1)
+
| 0x21 || 0x3 || Padding
 
|}
 
|}
   −
= PackedClusteringProcessorConfig =
+
= NotificationLedPattern =
This is "nn::irsensor::PackedClusteringProcessorConfig". This is a 0x28-byte struct.
  −
 
  −
This is converted from [[#ClusteringProcessorConfig]].
  −
 
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Description
+
! Offset || Size || Subcommand argdata bytepos || Subcommand argdata nibble || Description
 
|-
 
|-
| 0x0 || 0x8 || ExposureTime
+
| 0x0 || 0x1 || 0x0 || Low || Mini Cycle Base Duration. Value 0x1-0xF: 12.5ms - 187.5ms. Value 0x0 = 0ms/OFF.
 
|-
 
|-
| 0x8 || 0x1 || LightTarget
+
| 0x1 || 0x1 || 0x0 || High || Number of Mini Cycles + 1. Value 0x0-0xF: 1 - 16 mini cycles.
 
|-
 
|-
| 0x9 || 0x1 || Gain
+
| 0x2 || 0x1 || 0x1 || Low || Number of Full Cycles. Value 0x1-0xF: 1 - 15 full cycles. Value 0x0 is repeat forever, but if Mini Cycle Base Duration is set to 0x0, it does the 1st Mini Cycle with a 12.5ms base duration and then the LED stays on with LED Start Intensity.
 
|-
 
|-
| 0xA || 0x1 || IsNegativeImageUsed
+
| 0x3 || 0x1 || 0x1 || High || LED Start Intensity. Value 0x0-0xF: 0% - 100%. (In HW, 1 - 241 duty)
 
|-
 
|-
| 0xB || 0x5 || Reserved
+
| 0x4 || 0x1 || 0x2 || High || Mini Cycle 1 LED Intensity. Value 0x0-0xF: 0% - 100%. (In HW, 1 - 241 duty)
 
|-
 
|-
| 0x10 || 0x2 || WindowOfInterestX
+
| 0x5 || 0x1 || 0x3 || High || Fading Transition Steps to Mini Cycle 1 (Uses PWM). Value 0x0: Instant. Each step duration is based on Mini Cycle Step Duration Multiplier.
 
|-
 
|-
| 0x12 || 0x2 || WindowOfInterestY
+
| 0x6 || 0x1 || 0x3 || Low || Final Step Duration Multiplier of Mini Cycle 1. Value is a Multiplier of Mini Cycle Base Duration. Value 0x0: 12.5ms, 0x1 - xF: 1x - 15x.
 
|-
 
|-
| 0x14 || 0x2 || WindowOfInterestWidth
+
| 0x7 || 0x1 || || || Unused
 
|-
 
|-
| 0x16 || 0x2 || WindowOfInterestHeight
+
| 0x8 || 0x1 || 0x2 || Low || Mini Cycle 2 LED Intensity.
 
|-
 
|-
| 0x18 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
+
| 0x9 || 0x1 || 0x4 || High || Fading Transition Steps to Mini Cycle 2 (see above).
 
|-
 
|-
| 0x1C || 0x4 || ObjectPixelCountMin
+
| 0xA || 0x1 || 0x4 || Low || Final Step Duration Multiplier of Mini Cycle 2 (see above).
 
|-
 
|-
| 0x20 || 0x4 || ObjectPixelCountMax
+
| 0xB || 0x1 || || || Unused
 
|-
 
|-
| 0x24 || 0x1 || ObjectIntensityMin
+
| 0xC || 0x1 || 0x5 || High || Mini Cycle 3 LED Intensity.
 
|-
 
|-
| 0x25 || 0x1 || IsExternalLightFilterEnabled
+
| 0xD || 0x1 || 0x6 || High || Fading Transition Steps to Mini Cycle 3 (see above).
 
|-
 
|-
| 0x26 || 0x2 || Reserved
+
| 0xE || 0x1 || 0x6 || Low || Final Step Duration Multiplier of Mini Cycle 3 (see above).
|}
  −
 
  −
= ImageTransferProcessorConfig =
  −
This is "nn::irsensor::ImageTransferProcessorConfig".
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 0xF || 0x1 || || || Unused
 
|-
 
|-
| 0x0 || 0x8 || ExposureTime
+
| 0x10 || 0x1 || 0x5 || Low || Mini Cycle 4 LED Intensity.
 
|-
 
|-
| 0x8 || 0x4 || LightTarget
+
| 0x11 || 0x1 || 0x7 || High || Fading Transition Duration to Mini Cycle 4 (see above).
 
|-
 
|-
| 0xC || 0x4 || Gain
+
| 0x12 || 0x1 || 0x7 || Low || Final Step Duration Multiplier of Mini Cycle 4 (see above).
 
|-
 
|-
| 0x10 || 0x1 || IsNegativeImageUsed
+
| 0x13 || 0x1 || || || Unused
 
|-
 
|-
| 0x11 || 0x7 || Reserved
+
| 0x14 || 0x1 || 0x8 || High || Mini Cycle 5 LED Intensity.
 
|-
 
|-
| 0x18 || 0x4 || [[#ImageTransferProcessorFormat|Format]]
+
| 0x15 || 0x1 || 0x9 || High || Fading Transition Steps to Mini Cycle 5 (see above).
|}
  −
 
  −
= PackedImageTransferProcessorConfig =
  −
This is "nn::irsensor::PackedImageTransferProcessorConfig". This is a 0x18-byte struct.
  −
 
  −
This is converted from [[#ImageTransferProcessorConfig]].
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 0x16 || 0x1 || 0x9 || Low || Final Step Duration Multiplier of Mini Cycle 5 (see above).
 
|-
 
|-
| 0x0 || 0x8 || ExposureTime
+
| 0x17 || 0x1 || || || Unused
 
|-
 
|-
| 0x8 || 0x1 || LightTarget
+
| 0x18 || 0x1 || 0x8 || Low || Mini Cycle 6 LED Intensity.
 
|-
 
|-
| 0x9 || 0x1 || Gain
+
| 0x19 || 0x1 || 0xA || High || Fading Transition Steps to Mini Cycle 6 (see above).
 
|-
 
|-
| 0xA || 0x1 || IsNegativeImageUsed
+
| 0x1A || 0x1 || 0xA || Low || Final Step Duration Multiplier of Mini Cycle 6 (see above).
 
|-
 
|-
| 0xB || 0x5 || Reserved
+
| 0x1B || 0x1 || || || Unused
 
|-
 
|-
| 0x10 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
+
| 0x1C || 0x1 || 0xB || High || Mini Cycle 7 LED Intensity.
 
|-
 
|-
| 0x14 || 0x1 || [[#ImageTransferProcessorFormat|Format]]
+
| 0x1D || 0x1 || 0xC || High || Fading Transition Steps  to Mini Cycle 7 (see above).
 
|-
 
|-
| 0x15 || 0x3 || Reserved
+
| 0x1E || 0x1 || 0xC || Low || Final Step Duration Multiplier of Mini Cycle 7 (see above).
|}
  −
 
  −
= ImageTransferProcessorState =
  −
This is "nn::irsensor::ImageTransferProcessorState". This is a 0x10-byte struct.
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 0x1F || 0x1 || || || Unused
 
|-
 
|-
| 0x0 || 0x8 || SamplingNumber
+
| 0x20 || 0x1 || 0xB || Low || Mini Cycle 8 LED Intensity.
 
|-
 
|-
| 0x8 || 0x1 || AmbientNoiseLevel
+
| 0x21 || 0x1 || 0xD || Low || Fading Transition Steps to Mini Cycle 8 (see above).
 
|-
 
|-
| 0x9 || 0x7 || Reserved
+
| 0x22 || 0x1 || 0xD || High || Final Step Duration Multiplier of Mini Cycle 8 (see above).
|}
+
|-
 
+
| 0x23 || 0x1 || || || Unused
= PackedTeraPluginProcessorConfig =
  −
This is "nn::irsensor::PackedTeraPluginProcessorConfig". This is a 0x8-byte struct.
  −
 
  −
The data starting at offset 0x5 is only initialized by the user-process with [6.0.0+].
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 0x24 || 0x1 || 0xE || High || Mini Cycle 9 LED Intensity.
 
|-
 
|-
| 0x0 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
+
| 0x25 || 0x1 || 0xF || High || Fading Transition Steps to Mini Cycle 9 (see above).
 
|-
 
|-
| 0x4 || 0x1 || Mode
+
| 0x26 || 0x1 || 0xF || Low || Final Step Duration Multiplier of Mini Cycle 9 (see above).
 
|-
 
|-
| 0x5 || 0x1 ||  
+
| 0x27 || 0x1 || || || Unused
 
|-
 
|-
| 0x6 || 0x1 ||  
+
| 0x28 || 0x1 || 0xE || Low || Mini Cycle 10 LED Intensity.
 
|-
 
|-
| 0x7 || 0x1 ||  
+
| 0x29 || 0x1 || 0x10 || High || Fading Transition Steps to Mini Cycle 10 (see above).
|}
  −
 
  −
= PackedPointingProcessorConfig =
  −
This is "nn::irsensor::PackedPointingProcessorConfig". This is a 0xC-byte struct.
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 0x2A || 0x1 || 0x10 || Low || Final Step Duration Multiplier of Mini Cycle 10 (see above).
 
|-
 
|-
| 0x0 || 0x2 || WindowOfInterestX? (default is 0)
+
| 0x2B || 0x1 || || || Unused
 
|-
 
|-
| 0x2 || 0x2 || WindowOfInterestY? (default is 0)
+
| 0x2C || 0x1 || 0x11 || High || Mini Cycle 11 LED Intensity.
 
|-
 
|-
| 0x4 || 0x2 || WindowOfInterestWidth? (default is 320)
+
| 0x2D || 0x1 || 0x12 || High || Fading Transition Steps to Mini Cycle 11 (see above).
 
|-
 
|-
| 0x6 || 0x2 || WindowOfInterestHeight? (default is 240)
+
| 0x2E || 0x1 || 0x12 || Low || Final Step Duration Multiplier of Mini Cycle 11 (see above).
 
|-
 
|-
| 0x8 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
+
| 0x2F || 0x1 || || || Unused
|}
  −
 
  −
= PackedMcuVersion =
  −
This is "nn::irsensor::PackedMcuVersion". This is an u32.
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 0x30 || 0x1 || 0x11 || Low || Mini Cycle 12 LED Intensity.
 
|-
 
|-
| 0x0 || 0x2 || MajorVersion
+
| 0x31 || 0x1 || 0x13 || High || Fading Transition Steps to Mini Cycle 12 (see above).
 
|-
 
|-
| 0x2 || 0x2 || MinorVersion
+
| 0x32 || 0x1 || 0x13 || Low || Final Step Duration Multiplier of Mini Cycle 12 (see above).
|}
  −
 
  −
== Versions ==
  −
{| class="wikitable" border="1"
   
|-
 
|-
! MajorVersion || MinorVersion || SystemVersion
+
| 0x33 || 0x1 || || || Unused
 
|-
 
|-
| 0x3 || 0xB || [1.0.0+]
+
| 0x34 || 0x1 || 0x14 || High || Mini Cycle 13 LED Intensity.
 
|-
 
|-
| 0x4 || 0x12 || [4.0.0+]
+
| 0x35 || 0x1 || 0x15 || High || Fading Transition Steps to Mini Cycle 13 (see above).
 
|-
 
|-
| 0x5 || 0x18 || [5.0.0+]
+
| 0x36 || 0x1 || 0x15 || Low || Final Step Duration Multiplier of Mini Cycle 13 (see above).
 
|-
 
|-
| 0x6 || 0x1A || [6.0.0+]
+
| 0x37 || 0x1 || || || Unused
 
|-
 
|-
| 0x8 || 0x1B || [8.0.0+]
+
| 0x38 || 0x1 || 0x14 || Low || Mini Cycle 14 LED Intensity.
|}
  −
 
  −
= PackedFunctionLevel =
  −
This is nn::irsensor::PackedFunctionLevel. This is an u32.
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 0x39 || 0x1 || 0x16 || High || Fading Transition Steps to Mini Cycle 14 (see above).
 
|-
 
|-
| 0x0 || 0x1 || [[#IrSensorFunctionLevel]]
+
| 0x3A || 0x1 || 0x16 || Low || Final Step Duration Multiplier of Mini Cycle 14 (see above).
 
|-
 
|-
| 0x1 || 0x3 || Reserved
+
| 0x3B || 0x1 || || || Unused
|}
  −
 
  −
== IrSensorFunctionLevel ==
  −
This is "nn::irsensor::IrSensorFunctionLevel".
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Value || SystemVersion
+
| 0x3C || 0x1 || 0x17 || High || Mini Cycle 15 LED Intensity.
 
|-
 
|-
| 0 || [1.0.0+]
+
| 0x3D || 0x1 || 0x18 || High || Fading Transition Steps to Mini Cycle 15 (see above).
 
|-
 
|-
| 1 || [4.0.0+]
+
| 0x3E || 0x1 || 0x18 || Low || Final Step Duration Multiplier of Mini Cycle 15 (see above).
 
|-
 
|-
| 2 || [5.0.0+]
+
| 0x3F || 0x1 || || || Unused
 
|-
 
|-
| 3 || [6.0.0+]
+
| 0x40 || 0x1 || 0x17 || Low || Mini Cycle 16 LED Intensity.
 
|-
 
|-
| 4 || [8.0.0+]
+
| 0x41 || 0x1 || 0x19 || High || Fading Transition Steps to Mini Cycle 16 (see above). (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
|}
  −
 
  −
= ImageTransferProcessorExConfig =
  −
This is "nn::irsensor::ImageTransferProcessorExConfig".
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 0x42 || 0x1 || 0x19 || Low || Final Step Duration Multiplier of Mini Cycle 16 (see above). (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
 
|-
 
|-
| 0x0 || 0x8 || ExposureTime
+
| 0x43 || 0x1 || || || Unused
 
|-
 
|-
| 0x8 || 0x4 || LightTarget
+
| 0x44 || 0x1 || 0x1A || High || Unknown (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
 
|-
 
|-
| 0xC || 0x4 || Gain
+
| 0x45 || 0x1 || 0x1A || Low || Unknown (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
 
|-
 
|-
| 0x10 || 0x1 || IsNegativeImageUsed
+
| 0x46 || 0x1 || || || Padding
 
|-
 
|-
| 0x11 || 0x7 || Reserved
+
| 0x47 || 0x1 || || || Padding
|-
  −
| 0x18 || 0x4 || [[#ImageTransferProcessorFormat|OrigFormat]]
  −
|-
  −
| 0x1C || 0x4 || [[#ImageTransferProcessorFormat|TrimmingFormat]]
  −
|-
  −
| 0x20 || 0x2 || TrimmingStartX
  −
|-
  −
| 0x22 || 0x2 || TrimmingStartY
   
|-
 
|-
| 0x24 || 0x1 || IsExternalLightFilterEnabled
   
|}
 
|}
   −
= PackedImageTransferProcessorExConfig =
+
This is "nn::hid::system::NotificationLedPattern".
This is "nn::irsensor::PackedImageTransferProcessorExConfig". This is a 0x20-byte struct.
+
 
 +
This is a 0x48-byte struct.
 +
 
 +
The above descriptions in the table are based on the info from [https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/bluetooth_hid_subcommands_notes.md here].
   −
This is converted from [[#ImageTransferProcessorExConfig]].
+
argdata in the subcommand is initialized as follows: <code>((u8*)cmd_argdata)[pos] = u8_in[pos2] | u8_in[pos3]<<4;</code> Hence, 4bits from pairs of 2-bytes of the input struct are combined to write to the subcommand. Only the low 4bits of each used byte in the struct is used. This is written to stack initially, then copied to the actual cmd_argdata (the data immediately following the subcommandID byte). There's a total of 0x1B-bytes of cmd_argdata initialized from this.
    +
The layout of cmd_argdata is as follows:
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x8 || ExposureTime
+
| 0x0 || 0x1B || See above.
 
|-
 
|-
| 0x8 || 0x1 || LightTarget
+
| 0x1B || 0xB || Cleared to zero.
 
|-
 
|-
| 0x9 || 0x1 || Gain
+
| 0x26 || 0x5 || Unused
 
|-
 
|-
| 0xA || 0x1 || IsNegativeImageUsed
+
| 0x2B || 0x8 || Set to an input value, which is hard-coded 0.
 
|-
 
|-
| 0xB || 0x5 || Reserved
+
| 0x33 || 0x2 || Set to value 0.
 
|-
 
|-
| 0x10 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
+
| 0x35 || 0x1 || Set to value 1.
|-
+
|}
| 0x14 || 0x1 || [[#ImageTransferProcessorFormat|OrigFormat]]
+
 
 +
= DeviceType =
 +
This is "nn::hid::system::DeviceType".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Bits
 +
!  Description
 
|-
 
|-
| 0x15 || 0x1 || [[#ImageTransferProcessorFormat|TrimmingFormat]]
+
| 0
 +
| FullKey
 
|-
 
|-
| 0x16 || 0x2 || TrimmingStartX
+
| 1
 +
| DebugPad
 
|-
 
|-
| 0x18 || 0x2 || TrimmingStartY
+
| 2
 +
| HandheldLeft
 
|-
 
|-
| 0x1A || 0x1 || IsExternalLightFilterEnabled
+
| 3
 +
| HandheldRight
 
|-
 
|-
| 0x1B || 0x5 || Reserved
+
| 4
|}
+
| JoyLeft
 
  −
= PackedIrLedProcessorConfig =
  −
This is "nn::irsensor::PackedIrLedProcessorConfig". This is a 0x8-byte struct.
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 5
 +
| JoyRight
 
|-
 
|-
| 0x0 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
+
| 6
 +
| Palma
 
|-
 
|-
| 0x4 || 0x4 ||  
+
| 7
|}
+
| LarkHvcLeft
 
+
|-
= BusHandle =
+
| 8
This is "nn::hidbus::BusHandle". This is 0x8-bytes.
+
| LarkHvcRight
 
+
|-
{| class="wikitable" border="1"
+
| 9
 +
| LarkNesLeft
 +
|-
 +
| 10
 +
| LarkNesRight
 +
|-
 +
| 11
 +
| HandheldLarkHvcLeft
 
|-
 
|-
! Offset || Size || Description
+
| 12
 +
| HandheldLarkHvcRight
 
|-
 
|-
| 0x0 || 0x4 || AbstractedPadId
+
| 13
 +
| HandheldLarkNesLeft
 
|-
 
|-
| 0x4 || 0x1 || InternalIndex
+
| 14
 +
| HandheldLarkNesRight
 
|-
 
|-
| 0x5 || 0x1 || PlayerNumber
+
| 15
 +
| Lucia
 
|-
 
|-
| 0x6 || 0x1 || BusTypeId
+
| 16-30
 +
| Reserved
 
|-
 
|-
| 0x7 || 0x1 || IsValid
+
| 31
 +
| System
 
|}
 
|}
   −
= JoyPollingReceivedData =
+
= UniquePadId =
This is "nn::hidbus::JoyPollingReceivedData". This is 0x40-bytes.
+
This is "nn::hid::system::UniquePadId". This struct contains an u64.
   −
This is copied from the entries in [[#EnableJoyPollingReceiveMode|TransferMemory]] by GetJoyPollingReceivedData.
+
= UniquePadType =
 +
This is "nn::hid::system::UniquePadType".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0x0 || Other
 +
|-
 +
| 0x1 || FullKey
 +
|-
 +
| 0x2 || JoyRight
 +
|-
 +
| 0x3 || JoyLeft
 +
|-
 +
| 0x4 || DebugPad
 +
|}
 +
 
 +
= SystemButtonConfigEmbedded =
 +
This is "nn::hid::system::ButtonConfigEmbedded". This is a 0x2C8-byte struct.
 +
 
 +
= SystemButtonConfigFull =
 +
This is "nn::hid::system::ButtonConfigFull". This is a 0x2C8-byte struct.
 +
 
 +
= SystemButtonConfigLeft =
 +
This is "nn::hid::system::ButtonConfigLeft". This is a 0x1C8-byte struct.
 +
 
 +
= SystemButtonConfigRight =
 +
This is "nn::hid::system::ButtonConfigRight". This is a 0x1A0-byte struct.
 +
 
 +
= ButtonConfigEmbedded =
 +
This is "nn::hidconfig::ButtonConfigEmbedded". This is a 0x54-byte struct.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 2,998: Line 3,088:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x30 || Data
+
| 0x0 || 0x44 (4*17) || [[#ButtonConfig]], for the following buttons: DLeft, DUp, DRight, DDown, A, B, X, Y, L-Stick, R-Stick, L, R, ZL, ZR, -, +, Capture.
 
|-
 
|-
| 0x30 || 0x8 || Size of data.
+
| 0x44 || 0x8 || [[#JoystickConfig]], for the left-stick.
 
|-
 
|-
| 0x38 || 0x8 || Timestamp
+
| 0x4C || 0x8 || [[#JoystickConfig]], for the right-stick.
 
|}
 
|}
   −
= BusType =
+
== ButtonConfig ==
This is "nn::hidbus::BusType". This is an u32.
+
u32 button mapping config. Must be value 0 - 22, which selects what button to map to.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 3,012: Line 3,102:  
!  Description
 
!  Description
 
|-
 
|-
| 0 || JoyLeftRail
+
| 0 || A
 +
|-
 +
| 1 || B
 +
|-
 +
| 2 || X
 +
|-
 +
| 3 || Y
 +
|-
 +
| 4 || L-Stick
 +
|-
 +
| 5 || R-Stick
 +
|-
 +
| 6 || L
 +
|-
 +
| 7 || R
 +
|-
 +
| 8 || ZL
 
|-
 
|-
| 1 || JoyRightRail
+
| 9 || ZR
 
|-
 
|-
| 2 || [6.0.0+] LarkRightRail (for microphone)
+
| 10 || -
|}
+
|-
 +
| 11 || +
 +
|-
 +
| 12 || DLeft
 +
|-
 +
| 13 || DUp
 +
|-
 +
| 14 || DRight
 +
|-
 +
| 15 || DDown
 +
|-
 +
| 16 || SL_Left
 +
|-
 +
| 17 || SR_Left
 +
|-
 +
| 18 || SL_Right
 +
|-
 +
| 19 || SR_Right
 +
|-
 +
| 20 || HOME
 +
|-
 +
| 21 || Capture
 +
|-
 +
| 22 || Disabled
 +
|}
 +
 
 +
== JoystickConfig ==
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || Orientation. 0 = default, 1 = enabled for Left, 2 = enabled for Right.
 +
|-
 +
| 0x4 || 0x1 || StickChange
 +
|-
 +
| 0x5 || 0x3 || Padding
 +
|}
 +
 
 +
= ButtonConfigFull =
 +
This is "nn::hidconfig::ButtonConfigFull". This is a 0x54-byte struct.
 +
 
 +
This is identical to [[#ButtonConfigEmbedded]].
 +
 
 +
= ButtonConfigLeft =
 +
This is "nn::hidconfig::ButtonConfigLeft". This is a 0x34-byte struct.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x2C (4*11) || [[#ButtonConfig]], for the following buttons: DLeft, DUp, DRight, DDown, L-Stick, L, ZL, -, SL_Left, SR_Left, Capture.
 +
|-
 +
| 0x2C || 0x8 || [[#JoystickConfig]]
 +
|}
 +
 
 +
= ButtonConfigRight =
 +
This is "nn::hidconfig::ButtonConfigRight". This is a 0x30-byte struct.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x28 (4*10) || [[#ButtonConfig]], for the following buttons: A, B, X, Y, R-Stick, R, ZR, +, SL_Right, SR_Right.
 +
|-
 +
| 0x28 || 0x8 || [[#JoystickConfig]]
 +
|}
 +
 
 +
 
 +
= IrCameraHandle =
 +
This is "nn::irsensor::IrCameraHandle".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x1 || PlayerNumber
 +
|-
 +
| 0x1 || 0x1 || DeviceType
 +
|-
 +
| 0x2 || 0x2 || Reserved
 +
|}
 +
 
 +
= IrCameraStatus =
 +
This is "nn::irsensor::IrCameraStatus".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Available
 +
|-
 +
| 1 || Unsupported
 +
|-
 +
| 2 || Unconnected
 +
|}
 +
 
 +
= IrCameraInternalStatus =
 +
This is "nn::irsensor::IrCameraInternalStatus".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Stopped
 +
|-
 +
| 1 || FirmwareUpdateNeeded
 +
|-
 +
| 2 ||
 +
|-
 +
| 3 ||
 +
|-
 +
| 4 ||
 +
|-
 +
| 5 || FirmwareVersionRequested
 +
|-
 +
| 6 || FirmwareVersionIsInvalid
 +
|-
 +
| 7 || [4.0.0+] Ready
 +
|-
 +
| 8 || [4.0.0+] Setting
 +
|}
 +
 
 +
= IrSensorMode =
 +
This is "nn::irsensor::detail::StatusManager::IrSensorMode".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || None
 +
|-
 +
| 1 || [[#MomentProcessorState|MomentProcessor]]
 +
|-
 +
| 2 || [[#ClusteringProcessorState|ClusteringProcessor]]
 +
|-
 +
| 3 || [[#ImageTransferProcessorState|ImageTransferProcessor]]
 +
|-
 +
| 4 || [[#PointingProcessorMarkerState|PointingProcessorMarker]]
 +
|-
 +
| 5 || [[#TeraPluginProcessorState|TeraPluginProcessor]]
 +
|-
 +
| 6 || Unknown
 +
|}
 +
 
 +
= ImageProcessorStatus =
 +
This is "nn::irsensor::ImageProcessorStatus".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Stopped
 +
|-
 +
| 1 || Running
 +
|}
 +
 
 +
= ImageTransferProcessorFormat =
 +
This is "nn::irsensor::ImageTransferProcessorFormat".
 +
 
 +
This controls the IR Sensor image resolution.
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || 320x240
 +
|-
 +
| 1 || 160x120
 +
|-
 +
| 2 || 80x60
 +
|-
 +
| 3 || [4.0.0+] 40x30
 +
|-
 +
| 4 || [4.0.0+] 20x15
 +
|}
 +
 
 +
= MomentProcessorConfig =
 +
This is "nn::irsensor::MomentProcessorConfig".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || ExposureTime (default is 0x493E0)
 +
|-
 +
| 0x8 || 0x4 || LightTarget (default is 0)
 +
|-
 +
| 0xC || 0x4 || Gain (default is 0x8)
 +
|-
 +
| 0x10 || 0x1 || IsNegativeImageUsed (default is 0)
 +
|-
 +
| 0x11 || 0x7 || Reserved
 +
|-
 +
| 0x18 || 0x2 || WindowOfInterestX (default is 0)
 +
|-
 +
| 0x1A || 0x2 || WindowOfInterestY (default is 0)
 +
|-
 +
| 0x1C || 0x2 || WindowOfInterestWidth (default is 0x140)
 +
|-
 +
| 0x1E || 0x2 || WindowOfInterestHeight (default is 0xF0)
 +
|-
 +
| 0x20 || 0x4 || Preprocess (default is 0x1)
 +
|-
 +
| 0x24 || 0x4 || PreprocessIntensityThreshold (default is 0x50)
 +
|}
 +
 
 +
= PackedMomentProcessorConfig =
 +
This is "nn::irsensor::PackedMomentProcessorConfig".
 +
 
 +
This is converted from [[#MomentProcessorConfig]].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || ExposureTime (default is 0x493E0)
 +
|-
 +
| 0x8 || 0x1 || LightTarget (default is 0)
 +
|-
 +
| 0x9 || 0x1 || Gain (default is 0x8)
 +
|-
 +
| 0xA || 0x1 || IsNegativeImageUsed (default is 0)
 +
|-
 +
| 0xB || 0x5 || Reserved
 +
|-
 +
| 0x10 || 0x2 || WindowOfInterestX (default is 0)
 +
|-
 +
| 0x12 || 0x2 || WindowOfInterestY (default is 0)
 +
|-
 +
| 0x14 || 0x2 || WindowOfInterestWidth (default is 0x140)
 +
|-
 +
| 0x16 || 0x2 || WindowOfInterestHeight (default is 0xF0)
 +
|-
 +
| 0x18 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
 +
|-
 +
| 0x1C || 0x1 || Preprocess (default is 0x1)
 +
|-
 +
| 0x1D || 0x1 || PreprocessIntensityThreshold (default is 0x50)
 +
|-
 +
| 0x1E || 0x2 || Reserved
 +
|}
 +
 
 +
= ClusteringProcessorConfig =
 +
This is "nn::irsensor::ClusteringProcessorConfig".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || ExposureTime (default is 200000)
 +
|-
 +
| 0x8 || 0x4 || LightTarget (default is 0)
 +
|-
 +
| 0xC || 0x4 || Gain (default is 0x2)
 +
|-
 +
| 0x10 || 0x1 || IsNegativeImageUsed (default is 0)
 +
|-
 +
| 0x11 || 0x7 || Reserved
 +
|-
 +
| 0x18 || 0x2 || WindowOfInterestX (default is 0)
 +
|-
 +
| 0x1A || 0x2 || WindowOfInterestY (default is 0)
 +
|-
 +
| 0x1C || 0x2 || WindowOfInterestWidth (default is 320)
 +
|-
 +
| 0x1E || 0x2 || WindowOfInterestHeight (default is 240)
 +
|-
 +
| 0x20 || 0x4 || ObjectPixelCountMin (default is 0x3)
 +
|-
 +
| 0x24 || 0x4 || ObjectPixelCountMax (default is 0x12C00)
 +
|-
 +
| 0x28 || 0x4 || ObjectIntensityMin (default is 150)
 +
|-
 +
| 0x2C || 0x1 || IsExternalLightFilterEnabled (default is 0x1)
 +
|}
 +
 
 +
= PackedClusteringProcessorConfig =
 +
This is "nn::irsensor::PackedClusteringProcessorConfig".
 +
 
 +
This is converted from [[#ClusteringProcessorConfig]].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || ExposureTime
 +
|-
 +
| 0x8 || 0x1 || LightTarget
 +
|-
 +
| 0x9 || 0x1 || Gain
 +
|-
 +
| 0xA || 0x1 || IsNegativeImageUsed
 +
|-
 +
| 0xB || 0x5 || Reserved
 +
|-
 +
| 0x10 || 0x2 || WindowOfInterestX
 +
|-
 +
| 0x12 || 0x2 || WindowOfInterestY
 +
|-
 +
| 0x14 || 0x2 || WindowOfInterestWidth
 +
|-
 +
| 0x16 || 0x2 || WindowOfInterestHeight
 +
|-
 +
| 0x18 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
 +
|-
 +
| 0x1C || 0x4 || ObjectPixelCountMin
 +
|-
 +
| 0x20 || 0x4 || ObjectPixelCountMax
 +
|-
 +
| 0x24 || 0x1 || ObjectIntensityMin
 +
|-
 +
| 0x25 || 0x1 || IsExternalLightFilterEnabled
 +
|-
 +
| 0x26 || 0x2 || Reserved
 +
|}
 +
 
 +
= ImageTransferProcessorConfig =
 +
This is "nn::irsensor::ImageTransferProcessorConfig".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || ExposureTime
 +
|-
 +
| 0x8 || 0x4 || LightTarget
 +
|-
 +
| 0xC || 0x4 || Gain
 +
|-
 +
| 0x10 || 0x1 || IsNegativeImageUsed
 +
|-
 +
| 0x11 || 0x7 || Reserved
 +
|-
 +
| 0x18 || 0x4 || [[#ImageTransferProcessorFormat|Format]]
 +
|}
 +
 
 +
= PackedImageTransferProcessorConfig =
 +
This is "nn::irsensor::PackedImageTransferProcessorConfig".
 +
 
 +
This is converted from [[#ImageTransferProcessorConfig]].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || ExposureTime
 +
|-
 +
| 0x8 || 0x1 || LightTarget
 +
|-
 +
| 0x9 || 0x1 || Gain
 +
|-
 +
| 0xA || 0x1 || IsNegativeImageUsed
 +
|-
 +
| 0xB || 0x5 || Reserved
 +
|-
 +
| 0x10 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
 +
|-
 +
| 0x14 || 0x1 || [[#ImageTransferProcessorFormat|Format]]
 +
|-
 +
| 0x15 || 0x3 || Reserved
 +
|}
 +
 
 +
= ImageTransferProcessorState =
 +
This is "nn::irsensor::ImageTransferProcessorState".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || SamplingNumber
 +
|-
 +
| 0x8 || 0x4 || AmbientNoiseLevel
 +
|-
 +
| 0xC || 0x4 || Reserved
 +
|}
 +
 
 +
= TeraPluginProcessorConfig =
 +
This is "nn::irsensor::TeraPluginProcessorConfig".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x1 || Mode
 +
|-
 +
| 0x1 || 0x1 ||
 +
|-
 +
| 0x2 || 0x1 ||
 +
|-
 +
| 0x3 || 0x1 ||
 +
|}
 +
 
 +
= PackedTeraPluginProcessorConfig =
 +
This is "nn::irsensor::PackedTeraPluginProcessorConfig".
 +
 
 +
This is converted from [[#TeraPluginProcessorConfig]]. The data starting at offset 0x5 is only initialized by the user-process with [6.0.0+].
 +
 
 +
[[#TeraPluginProcessorConfig]] +0x0, +0x2, and +0x3 are copied to +0x4, 0x6, and +0x7 here. +0x5 here is set to 0x2 | ([[#TeraPluginProcessorConfig]]+0x1 << 7).
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
 +
|-
 +
| 0x4 || 0x1 || Mode
 +
|-
 +
| 0x5 || 0x1 ||
 +
|-
 +
| 0x6 || 0x1 ||
 +
|-
 +
| 0x7 || 0x1 ||
 +
|}
 +
 
 +
= PointingProcessorConfig =
 +
This is "nn::irsensor::PointingProcessorConfig".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x2 || WindowOfInterestX (default is 0)
 +
|-
 +
| 0x2 || 0x2 || WindowOfInterestY (default is 0)
 +
|-
 +
| 0x4 || 0x2 || WindowOfInterestWidth (default is 320)
 +
|-
 +
| 0x6 || 0x2 || WindowOfInterestHeight (default is 240)
 +
|}
 +
 
 +
= PackedPointingProcessorConfig =
 +
This is "nn::irsensor::PackedPointingProcessorConfig".
 +
 
 +
This is converted from [[#PointingProcessorConfig]].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x2 || WindowOfInterestX (default is 0)
 +
|-
 +
| 0x2 || 0x2 || WindowOfInterestY (default is 0)
 +
|-
 +
| 0x4 || 0x2 || WindowOfInterestWidth (default is 320)
 +
|-
 +
| 0x6 || 0x2 || WindowOfInterestHeight (default is 240)
 +
|-
 +
| 0x8 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
 +
|}
 +
 
 +
= PackedMcuVersion =
 +
This is "nn::irsensor::PackedMcuVersion".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x2 || MajorVersion
 +
|-
 +
| 0x2 || 0x2 || MinorVersion
 +
|}
 +
 
 +
== Versions ==
 +
{| class="wikitable" border="1"
 +
|-
 +
! MajorVersion || MinorVersion || SystemVersion
 +
|-
 +
| 0x3 || 0xB || [1.0.0+]
 +
|-
 +
| 0x4 || 0x12 || [4.0.0+]
 +
|-
 +
| 0x5 || 0x18 || [5.0.0+]
 +
|-
 +
| 0x6 || 0x1A || [6.0.0+]
 +
|-
 +
| 0x8 || 0x1B || [8.0.0+]
 +
|}
 +
 
 +
= PackedFunctionLevel =
 +
This is nn::irsensor::PackedFunctionLevel.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x1 || [[#IrSensorFunctionLevel]]
 +
|-
 +
| 0x1 || 0x3 || Reserved
 +
|}
 +
 
 +
== IrSensorFunctionLevel ==
 +
This is "nn::irsensor::IrSensorFunctionLevel".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || SystemVersion
 +
|-
 +
| 0 || [1.0.0+]
 +
|-
 +
| 1 || [4.0.0+]
 +
|-
 +
| 2 || [5.0.0+]
 +
|-
 +
| 3 || [6.0.0+]
 +
|-
 +
| 4 || [8.0.0+]
 +
|}
 +
 
 +
= ImageTransferProcessorExConfig =
 +
This is "nn::irsensor::ImageTransferProcessorExConfig".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || ExposureTime
 +
|-
 +
| 0x8 || 0x4 || LightTarget
 +
|-
 +
| 0xC || 0x4 || Gain
 +
|-
 +
| 0x10 || 0x1 || IsNegativeImageUsed
 +
|-
 +
| 0x11 || 0x7 || Reserved
 +
|-
 +
| 0x18 || 0x4 || [[#ImageTransferProcessorFormat|OrigFormat]]
 +
|-
 +
| 0x1C || 0x4 || [[#ImageTransferProcessorFormat|TrimmingFormat]]
 +
|-
 +
| 0x20 || 0x2 || TrimmingStartX
 +
|-
 +
| 0x22 || 0x2 || TrimmingStartY
 +
|-
 +
| 0x24 || 0x1 || IsExternalLightFilterEnabled
 +
|}
 +
 
 +
= PackedImageTransferProcessorExConfig =
 +
This is "nn::irsensor::PackedImageTransferProcessorExConfig".
 +
 
 +
This is converted from [[#ImageTransferProcessorExConfig]].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || ExposureTime
 +
|-
 +
| 0x8 || 0x1 || LightTarget
 +
|-
 +
| 0x9 || 0x1 || Gain
 +
|-
 +
| 0xA || 0x1 || IsNegativeImageUsed
 +
|-
 +
| 0xB || 0x5 || Reserved
 +
|-
 +
| 0x10 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
 +
|-
 +
| 0x14 || 0x1 || [[#ImageTransferProcessorFormat|OrigFormat]]
 +
|-
 +
| 0x15 || 0x1 || [[#ImageTransferProcessorFormat|TrimmingFormat]]
 +
|-
 +
| 0x16 || 0x2 || TrimmingStartX
 +
|-
 +
| 0x18 || 0x2 || TrimmingStartY
 +
|-
 +
| 0x1A || 0x1 || IsExternalLightFilterEnabled
 +
|-
 +
| 0x1B || 0x5 || Reserved
 +
|}
 +
 
 +
= IrLedProcessorConfig =
 +
This is "nn::irsensor::IrLedProcessorConfig".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || LightTarget
 +
|}
 +
 
 +
= PackedIrLedProcessorConfig =
 +
This is "nn::irsensor::PackedIrLedProcessorConfig".
 +
 
 +
This is converted from [[#IrLedProcessorConfig]].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || [[#PackedMcuVersion|RequiredMcuVersion]]
 +
|-
 +
| 0x4 || 0x1 || LightTarget
 +
|-
 +
| 0x5 || 0x3 || Padding
 +
|}
 +
 
 +
= AdaptiveClusteringProcessorConfig =
 +
This is "nn::irsensor::AdaptiveClusteringProcessorConfig".
 +
 
 +
AdaptiveClusteringProcessor was added with [5.0.0+].
 +
 
 +
This is converted to [[#TeraPluginProcessorConfig]] by the user-process. [[#TeraPluginProcessorConfig]]+0x3 is zero.
 +
 
 +
The default config is all-zero.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || [[#AdaptiveClusteringMode]]
 +
|-
 +
| 0x4 || 0x4 || [6.0.0+] [[#AdaptiveClusteringTargetDistance]]
 +
|}
 +
 
 +
== AdaptiveClusteringMode ==
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || StaticFov
 +
|-
 +
| 1 || DynamicFov
 +
|}
 +
 
 +
Controls the mode for [[#TeraPluginProcessorConfig]] (DynamicFov -> 0x10; StaticFov -> 0x0F).
 +
 
 +
== AdaptiveClusteringTargetDistance ==
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || Near
 +
|-
 +
| 1 || Middle
 +
|-
 +
| 2 || Far
 +
|}
 +
 
 +
Controls the second and third bytes for [[#TeraPluginProcessorConfig]] (Near-> 0x00, 0x00; Middle -> 0x01, 0x03; Far -> 0x01, 0x08).
 +
 
 +
= HandAnalysisConfig =
 +
This is "nn::irsensor::HandAnalysisConfig".
 +
 
 +
This is converted to [[#TeraPluginProcessorConfig]] by the user-process, which is all-zero except the mode.
 +
* pre-4.0.0: [[#TeraPluginProcessorConfig]] mode = [[#HandAnalysisMode]] - 1.
 +
* [4.0.0+]: Silhouette = 0x5, Image = 0x6, SilhouetteAndImage = 0x7, SilhouetteOnly = 0xA.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || [[#HandAnalysisMode]]
 +
|}
 +
 
 +
== HandAnalysisMode ==
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || None (invalid)
 +
|-
 +
| 1 || Silhouette
 +
|-
 +
| 2 || Image
 +
|-
 +
| 3 || SilhouetteAndImage
 +
|-
 +
| 4 || [4.0.0+] SilhouetteOnly
 +
|}
 +
 
 +
= BusHandle =
 +
This is "nn::hidbus::BusHandle".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || AbstractedPadId
 +
|-
 +
| 0x4 || 0x1 || InternalIndex
 +
|-
 +
| 0x5 || 0x1 || PlayerNumber
 +
|-
 +
| 0x6 || 0x1 || BusTypeId
 +
|-
 +
| 0x7 || 0x1 || IsValid
 +
|}
 +
 
 +
= JoyPollingReceivedData =
 +
This is "nn::hidbus::JoyPollingReceivedData".
 +
 
 +
This is copied from the entries in [[#EnableJoyPollingReceiveMode|TransferMemory]] by GetJoyPollingReceivedData.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x30 || Data
 +
|-
 +
| 0x30 || 0x8 || Size of data.
 +
|-
 +
| 0x38 || 0x8 || Timestamp
 +
|}
 +
 
 +
= BusType =
 +
This is "nn::hidbus::BusType".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0 || JoyLeftRail
 +
|-
 +
| 1 || JoyRightRail
 +
|-
 +
| 2 || [6.0.0+] LarkRightRail (for microphone)
 +
|}
    
= JoyPollingMode =
 
= JoyPollingMode =
This is "nn::hidbus::JoyPollingMode". This is an u32. This must be one of the below values otherwise [[#EnableJoyPollingReceiveMode]] will assert.
+
This is "nn::hidbus::JoyPollingMode".
 
+
 
{| class="wikitable" border="1"
+
{| class="wikitable" border="1"
!  Value
+
!  Value
!  Description
+
!  Description
|-
+
|-
| 0 || sdknso uses <code>GetJoyDisableSixAxisPollingDataAccessor</code> with this.
+
| 0 || sdknso uses <code>GetJoyDisableSixAxisPollingDataAccessor</code> with this.
|-
+
|-
| 1 || sdknso uses <code>GetJoyEnableSixAxisPollingDataAccessor</code> with this.
+
| 1 || sdknso uses <code>GetJoyEnableSixAxisPollingDataAccessor</code> with this.
|-
+
|-
| 2 || [6.0.0+] sdknso uses <code>GetJoyButtonOnlyPollingDataAccessor</code> with this.
+
| 2 || [6.0.0+] sdknso uses <code>GetJoyButtonOnlyPollingDataAccessor</code> with this.
|}
+
|}
 
+
 
= ExternalDevices =
+
Other values causes [[#EnableJoyPollingReceiveMode]] to assert.
The following devices are used via hidbus:
+
 
* [[Ring-Con]]
+
= ExternalDevices =
* Famicom right controller (with microphone)
+
The following devices are used via hidbus:
 
+
* [[Ring-Con]]
= RomFS =
+
* Famicom right controller (with microphone)
The hid-sysmodule RomFS contains:
+
 
   ftmFwUpdate
+
= RomFS =
     ├── NTD_4CD_1801.fts256
+
The hid-sysmodule RomFS contains:
     ├── NTD_4CD_2602.fts256
+
   ftmFwUpdate
     ├── NTD_4CD_3801.fts256
+
     ├── NTD_4CD_1801.fts256
     └── NTD_4CD_xxxx.fts256 [7.0.0+]
+
     ├── NTD_4CD_2602.fts256
 
+
     ├── NTD_4CD_3801.fts256
These are firmware files for the touchscreen controller.
+
     └── NTD_4CD_xxxx.fts256 [7.0.0+]
 
+
 
[9.0.0+] The hid-sysmodule RomFS now contains:
+
These are firmware files for the touchscreen controller.
   ftmFwUpdate
+
 
     ├── FTS_00120100.fts256
+
[9.0.0+] The hid-sysmodule RomFS now contains:
     ├── FTS_32000001.fts256
+
   ftmFwUpdate
     ├── FTS_32000102.fts256
+
     ├── FTS_00120100.fts256
     ├── FTS_32000302.fts256
+
     ├── FTS_32000001.fts256
     └── FTS_32000402.fts256
+
     ├── FTS_32000102.fts256
 +
     ├── FTS_32000302.fts256
 +
     └── FTS_32000402.fts256
 +
 
 +
= Firmware update =
 +
HID-sysmodule mounts the contents of title [[Title_list|0100000000000822]] as "systemData" or the contents of title [[Title_list|010000000000B22B]] as "systemDataD". Both titles contain the same files, but [[Title_list|0100000000000822]] is used on retail units while [[Title_list|010000000000B22B]] is used for development.
   −
= Firmware update =
+
[10.0.0+]: The RomFs for hid-sysmodule was removed, the data which used to be in that RomFs was moved into this SystemData (the below .fts256 files).
HID-sysmodule mounts the contents of title [[Title_list|0100000000000822]] as "systemData" or the contents of title [[Title_list|010000000000B22B]] as "systemDataD". Both titles contain the same files, but [[Title_list|0100000000000822]] is used on retail units while [[Title_list|010000000000B22B]] is used for development.
      
These titles contain the following files:
 
These titles contain the following files:
Line 3,074: Line 3,900:  
* [9.0.0+] '''sioh.bin''' - Switch Lite Joy-Con firmware.  
 
* [9.0.0+] '''sioh.bin''' - Switch Lite Joy-Con firmware.  
 
* [9.0.0+] '''sioh_iap.bin''' - Switch Lite Joy-Con (IAP profile) firmware.
 
* [9.0.0+] '''sioh_iap.bin''' - Switch Lite Joy-Con (IAP profile) firmware.
 +
* [10.0.0+] '''FTS_00120100.fts256'''
 +
* [10.0.0+] '''FTS_32000001.fts256'''
 +
* [10.0.0+] '''FTS_32000102.fts256'''
 +
* [10.0.0+] '''FTS_32000302.fts256'''
 +
* [10.0.0+] '''FTS_32000402.fts256'''
 +
* [10.0.0+] '''TouchScreenConfiguration.csv'''
 +
* [10.0.0+] '''TouchScreenFirmwareInfo.csv'''
    
[[Category:Services]]
 
[[Category:Services]]

Navigation menu