Changes

Jump to navigation Jump to search
15,829 bytes added ,  17:56, 2 April 2020
no edit summary
Line 1,148: Line 1,148:  
= irs =
 
= irs =
 
This is "nn::irsensor::IIrSensorServer".
 
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"
 
{| class="wikitable" border="1"
Line 1,199: Line 1,203:  
Takes a PID-descriptor and an [[AM_services|AppletResourceUserId]]. Returns a SharedMemory handle.
 
Takes a PID-descriptor and an [[AM_services|AppletResourceUserId]]. Returns a SharedMemory handle.
   −
The SharedMemory is mapped with permissions=read-only and size=0x8000.
+
The SharedMemory is "nn::irsensor::detail::StatusManager". It's mapped with permission read-only and size 0x8000.
   −
== StopImageProcessor ==
+
It's structure is as follows:
Takes a PID-descriptor, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. No output.
     −
== RunMomentProcessor ==
+
{| class="wikitable" border="1"
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], and a [[#PackedMomentProcessorConfig]]. No output.
+
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x7FB0 || Array of [[#DeviceFormat]]
 +
|-
 +
| 0x7FB0 || 0x50 || Array of [[#AruidFormat]]
 +
|}
   −
== RunClusteringProcessor ==
+
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.
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], and a [[#PackedClusteringProcessorConfig]]. No output.
     −
== RunImageTransferProcessor ==
+
=== DeviceFormat ===
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], a [[#PackedImageTransferProcessorConfig]], an u64 for the TransferMemory_size, and a TransferMemory handle. No output.
+
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x4 || [[#IrCameraStatus]]
 +
|-
 +
| 0x4 || 0x4 || [[#IrCameraInternalStatus]]
 +
|-
 +
| 0x8 || 0x8 || [[#IrSensorMode]]
 +
|-
 +
| 0x10 || 0xE20 || [[#ProcessorStateRingLifo]]
 +
|}
   −
Official sw creates the TransferMemory with an user-specified buffer and permissions=0.
+
==== 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).
   −
== GetImageTransferProcessorState ==
+
{| class="wikitable" border="1"
Takes a PID-descriptor, a type-0x6 output buffer, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. Returns an [[#ImageTransferProcessorState]]. No output.
+
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || Start
 +
|-
 +
| 0x8 || 0x4 || Count
 +
|-
 +
| 0xC || 0x4 || Padding
 +
|-
 +
| 0x10 || Variable || ProcessorState
 +
|}
 +
 
 +
The maximum element count is 6 for [[#PointingProcessorMarkerState]] or 5 for any of the other states.
   −
== RunTeraPluginProcessor==
+
ProcessorState is specialized depending on the value of [[#IrSensorMode]].
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedTeraPluginProcessorConfig]] (immediately after the previous word), and an [[AM_services|AppletResourceUserId]]. No output.
     −
== GetNpadIrCameraHandle ==
+
===== MomentProcessorState =====
Takes an input [[#NpadIdType]]. Returns an output [[#IrCameraHandle]].
+
This is "nn::irsensor::MomentProcessorState".
   −
== RunPointingProcessor ==
+
{| class="wikitable" border="1"
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedPointingProcessorConfig]] (immediately after the previous word), and an [[AM_services|AppletResourceUserId]]. No output.
+
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || SamplingNumber
 +
|-
 +
| 0x8 || 0x8 || TimeStamp
 +
|-
 +
| 0x10 || 0x4 || AmbientNoiseLevel
 +
|-
 +
| 0x14 || 0x4 || Reserved
 +
|-
 +
| 0x18 || 0x240 || Array of [[#MomentStatistic]]
 +
|}
   −
== SuspendImageProcessor ==
+
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.
Takes a PID-descriptor, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. No output.
     −
== CheckFirmwareVersion ==
+
====== MomentStatistic ======
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedMcuVersion]], and an [[AM_services|AppletResourceUserId]]. No output.
+
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.
 
  −
== 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_size, and a TransferMemory handle. No output.
  −
 
  −
Official sw creates the TransferMemory with an user-specified buffer and permissions=0.
  −
 
  −
== 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".
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Offset || Size || Description
 
|-
 
|-
| 500 || [[#SetAppletResourceUserId]]
+
| 0x0 || 0x4 || float AverageIntensity
 
|-
 
|-
| 501 || [[#RegisterAppletResourceUserId]]
+
| 0x4 || 0x4 || float CentroidX
|-
  −
| 502 || [[#UnregisterAppletResourceUserId]]
   
|-
 
|-
| 503 || [[#EnableAppletToGetInput]]
+
| 0x8 || 0x4 || float CentroidY
 
|}
 
|}
   −
== SetAppletResourceUserId ==
+
===== ClusteringProcessorState =====
Takes an [[AM_services|AppletResourceUserId]]. No output.
+
This is "nn::irsensor::ClusteringProcessorState".
 
  −
== 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"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || SamplingNumber
 
|-
 
|-
| 0 || [[#AcquireDevice]]
+
| 0x8 || 0x8 || TimeStamp
 
|-
 
|-
| 1 || [[#ReleaseDevice]]
+
| 0x10 || 0x1 || ObjectCount
 
|-
 
|-
| 2 || [[#GetCtrlSession]]
+
| 0x11 || 0x3 || Reserved
 
|-
 
|-
| 3 || [[#GetReadSession]]
+
| 0x14 || 0x4 || AmbientNoiseLevel
 
|-
 
|-
| 4 || [1.0.0-2.3.0] [[#GetWriteSession]]
+
| 0x18 || 0x180 || Array of [[#ClusteringData]]
 
|}
 
|}
   −
== AcquireDevice ==
+
The array of [[#ClusteringData]] can hold up to 16 entries.
Takes an input s32, no output.
  −
 
  −
== ReleaseDevice ==
  −
Takes an input s32, no output.
  −
 
  −
== GetCtrlSession ==
  −
Takes an input u32, returns an [[#ICtrlSession]].
  −
 
  −
== GetReadSession ==
  −
Takes an input u32, returns an [[#IReadSession]].
  −
 
  −
== GetWriteSession ==
  −
Takes an input u32, returns an [[#IWriteSession]].
  −
 
  −
== ICtrlSession ==
  −
This is "nn::ahid::ICtrlSession".
  −
 
  −
This no longer exists in [9.0.0+].
      +
====== ClusteringData ======
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Offset || Size || Description
 
|-
 
|-
| 0 || GetString
+
| 0x0 || 0x4 || float AverageIntensity
 
|-
 
|-
| 1 || GetCodeBook
+
| 0x4 || 0x4 || float CentroidX
 
|-
 
|-
| 2 || GetReport
+
| 0x8 || 0x4 || float CentroidY
 
|-
 
|-
| 3 || SetReport
+
| 0xC || 0x4 || PixelCount
 
|-
 
|-
| 4 || GetIdle
+
| 0x10 || 0x2 || BoundX
 
|-
 
|-
| 5 || SetIdle
+
| 0x12 || 0x2 || BoundY
 
|-
 
|-
| 6 || GetProtocol
+
| 0x14 || 0x2 || BoundtWidth
 
|-
 
|-
| 7 || SetProtocol
+
| 0x16 || 0x2 || BoundHeight
 +
|}
 +
 
 +
===== PointingProcessorMarkerState =====
 +
This is "nn::irsensor::PointingProcessorMarkerState".
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || SamplingNumber
 +
|-
 +
| 0x8 || 0x8 || TimeStamp
 +
|-
 +
| 0x10 || 0x1 || PointingStatus
 +
|-
 +
| 0x11 || 0xB || Reserved
 +
|-
 +
| 0x1C || 0x4 || float PositionX
 +
|-
 +
| 0x20 || 0x4 || float PositionY
 +
|-
 +
| 0x24 || 0xC || Reserved
 +
|-
 +
| 0x30 || 0x1 || PointingStatus
 +
|-
 +
| 0x31 || 0xB || Reserved
 +
|-
 +
| 0x3C || 0x4 || float PositionX
 +
|-
 +
| 0x40 || 0x4 || float PositionY
 +
|-
 +
| 0x44 || 0xC || Reserved
 
|-
 
|-
| 8 || GetDescriptor
+
| 0x50 || 0x1 || PointingStatus
 
|-
 
|-
| 9 || SetDescriptor
+
| 0x51 || 0xB || Reserved
 
|-
 
|-
| 10 || GetStateChangeEvent
+
| 0x5C || 0x4 || float PositionX
 
|-
 
|-
| 11 || SignalStateChangeEvent
+
| 0x60 || 0x4 || float PositionY
 
|-
 
|-
| 12 || [3.0.0+] Write
+
| 0x64 || 0xC || Reserved
 
|}
 
|}
   −
All of these use USB [[USB_services|CtrlXfer]], except for GetStateChangeEvent and SignalStateChangeEvent, and GetCodeBook which copies 0x4000-bytes from state to output.
+
===== PointingProcessorState =====
 +
This is "nn::irsensor::PointingProcessorState".
   −
== IReadSession ==
+
This is created from [[#PointingProcessorMarkerState]].
This is "nn::ahid::IReadSession".
  −
 
  −
This no longer exists in [9.0.0+].
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || SamplingNumber
 +
|-
 +
| 0x8 || 0x8 || TimeStamp
 +
|-
 +
| 0x10 || 0x4 || PointingStatus
 +
|-
 +
| 0x14 || 0x4 || float PositionX
 +
|-
 +
| 0x18 || 0x4 || float PositionY
 
|-
 
|-
| 0 || [[#Read]]
+
| 0x1C || 0x4 || Reserved
 
|}
 
|}
   −
=== Read ===
+
===== TeraPluginProcessorState =====
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.
+
This is "nn::irsensor::TeraPluginProcessorState".
   −
[3.0.0+] Now takes a total of 8-bytes of input.
+
{| class="wikitable" border="1"
 +
|-
 +
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x8 || SamplingNumber
 +
|-
 +
| 0x8 || 0x8 || TimeStamp
 +
|-
 +
| 0x10 || 0x4 || AmbientNoiseLevel
 +
|-
 +
| 0x14 || 0x12C || PluginData
 +
|}
   −
== IWriteSession ==
+
===== AdaptiveClusteringProcessorState =====
This is "nn::ahid::IWriteSession".
+
This is "nn::irsensor::AdaptiveClusteringProcessorState".
   −
This was removed with [3.0.0+].
+
This is created from [[#TeraPluginProcessorState]].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Offset || Size || Description
 
|-
 
|-
| 0 || [[#Write]]
+
| 0x0 || 0x8 || SamplingNumber
|}
  −
 
  −
=== 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
+
| 0x8 || 0x8 || TimeStamp
 
|-
 
|-
| 0 || GetDeviceEntries
+
| 0x10 || 0x4 || AmbientNoiseLevel
 
|-
 
|-
| 1 || GetDeviceList
+
| 0x14 || 0x4 || AccuracyLevel
 
|-
 
|-
| 2 || GetDeviceParameters
+
| 0x18 || 0x1 || ObjectCount
 
|-
 
|-
| 3 || AttachDevice
+
| 0x19 || 0x1 || BackgroundIntensity
 
|-
 
|-
| 4 || DetachDevice
+
| 0x1A || 0x6 || Reserved
 
|-
 
|-
| 5 || [6.0.0+] SetDeviceFilter
+
| 0x20 || 0x200 || Array of [[#AdaptiveClusteringData]]
 
|}
 
|}
   −
= xcd:sys =
+
The array of [[#AdaptiveClusteringData]] can hold up to 16 entries.
This is "nn::xcd::detail::ISystemServer".
      +
====== AdaptiveClusteringData ======
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Offset || Size || Description
 
|-
 
|-
| 0 || GetDataFormat
+
| 0x0 || 0x4 || float CentroidX
 
|-
 
|-
| 1 || SetDataFormat
+
| 0x4 || 0x4 || float CentroidY
 
|-
 
|-
| 2 || GetMcuState
+
| 0x8 || 0x4 || float Area
 
|-
 
|-
| 3 || SetMcuState
+
| 0xC || 0x4 || IsIncomplete
 +
|}
 +
 
 +
===== HandAnalysisImageState =====
 +
This is "nn::irsensor::HandAnalysisImageState".
 +
 
 +
This is created from [[#TeraPluginProcessorState]].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 4 || GetMcuVersionForNfc
+
! Offset || Size || Description
 
|-
 
|-
| 5 || CheckNfcDevicePower
+
| 0x0 || 0x8 || SamplingNumber
 
|-
 
|-
| 6 || [5.0.0+] SetMcuStateImmediate
+
| 0x8 || 0x4 || AmbientNoiseLevel
 
|-
 
|-
| 10 || SetNfcEvent
+
| 0xC || 0x960 || Image
 
|-
 
|-
| 11 || GetNfcInfo
+
| 0x96C || 0x4 || Reserved
 +
|}
 +
 
 +
===== HandAnalysisSilhouetteState =====
 +
This is "nn::irsensor::HandAnalysisSilhouetteState".
 +
 
 +
This is created from [[#TeraPluginProcessorState]].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 12 || StartNfcDiscovery
+
! Offset || Size || Description
 
|-
 
|-
| 13 || StopNfcDiscovery
+
| 0x0 || 0x8 || SamplingNumber
 
|-
 
|-
| 14 || StartNtagRead
+
| 0x8 || 0x4 || AmbientNoiseLevel
 
|-
 
|-
| 15 || StartNtagWrite
+
| 0xC || 0x1354 || Unknown
 +
|}
 +
 
 +
===== HandAnalysisSilhouetteStateWithFullFrameShape =====
 +
This is "nn::irsensor::HandAnalysisSilhouetteStateWithFullFrameShape".
 +
 
 +
This is created from [[#TeraPluginProcessorState]].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 16 || SendNfcRawData
+
! Offset || Size || Description
 
|-
 
|-
| 17 || RegisterMifareKey
+
| 0x0 || 0x8 || SamplingNumber
 
|-
 
|-
| 18 || ClearMifareKey
+
| 0x8 || 0x4 || AmbientNoiseLevel
 
|-
 
|-
| 19 || StartMifareRead
+
| 0xC || 0x156C || Unknown
 +
|}
 +
 
 +
=== AruidFormat ===
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 20 || StartMifareWrite
+
! Offset || Size || Description
 
|-
 
|-
| 101 || GetAwakeTriggerReasonForLeftRail
+
| 0x0 || 0x8 || IrSensorAruid
 
|-
 
|-
| 102 || GetAwakeTriggerReasonForRightRail
+
| 0x8 || 0x8 || IrSensorAruidStatus
 
|}
 
|}
   −
[5.0.0+] SetDataFormat, SetMcuState, and ClearMifareKey: now takes a total of 0xC-bytes of input instead of 0x10.
+
== StopImageProcessor ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. No output.
   −
[6.0.0+]: The buffer type used by GetNfcInfo is now 0x32 instead of 0x1A.
+
== RunMomentProcessor ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], and a [[#PackedMomentProcessorConfig]]. No output.
   −
= hidbus =
+
== RunClusteringProcessor ==
This is "nn::hidbus::IHidbusServer".
+
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], and a [[#PackedClusteringProcessorConfig]]. No output.
 +
 
 +
== 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.
 +
 
 +
The TransferMemory is created with an user specified buffer and permission none.
 +
 
 +
== GetImageTransferProcessorState ==
 +
Takes a PID-descriptor, a type-0x6 output buffer, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. Returns an [[#ImageTransferProcessorState]]. No output.
 +
 
 +
== RunTeraPluginProcessor==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedTeraPluginProcessorConfig]] (immediately after the previous word), and an [[AM_services|AppletResourceUserId]]. No output.
   −
This was added with [5.0.0+].
+
== GetNpadIrCameraHandle ==
 +
Takes an input [[#NpadIdType]]. Returns an output [[#IrCameraHandle]].
   −
Official sw opens a temporary service-session for each func using this, with it being closed once done: no global session is kept open.
+
== RunPointingProcessor ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedPointingProcessorConfig]] (immediately after the previous word), and an [[AM_services|AppletResourceUserId]]. No output.
   −
{| class="wikitable" border="1"
+
== SuspendImageProcessor ==
|-
+
Takes a PID-descriptor, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. No output.
! Cmd || Name
  −
|-
  −
| 1 || [[#GetBusHandle]]
  −
|-
  −
| 2 || [[#IsExternalDeviceConnected]]
  −
|-
  −
| 3 || [[#Initialize]]
  −
|-
  −
| 4 || [[#Finalize]]
  −
|-
  −
| 5 || [[#EnableExternalDevice]]
  −
|-
  −
| 6 || [[#GetExternalDeviceId]]
  −
|-
  −
| 7 || [[#SendCommandAsync]]
  −
|-
  −
| 8 || [[#GetSendCommandAsynceResult]]
  −
|-
  −
| 9 || [[#SetEventForSendCommandAsycResult]]
  −
|-
  −
| 10 || [[#GetSharedMemoryHandle]]
  −
|-
  −
| 11 || [[#EnableJoyPollingReceiveMode]]
  −
|-
  −
| 12 || [[#DisableJoyPollingReceiveMode]]
  −
|-
  −
| 13 || [5.0.0-6.2.0] GetPollingData
  −
|-
  −
| 14 || [6.0.0+] [[#SetStatusManagerType]]
  −
|}
     −
sdknso doesn't use the GetPollingData cmd.
+
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+].
   −
== GetBusHandle ==
+
== CheckFirmwareVersion ==
Takes an input u32 [[#NpadIdType]], an u64 [[#BusType]], an u64 [[AM_services|AppletResourceUserId]], returns an output u8 bool and a [[#BusHandle]].
+
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedMcuVersion]], and an [[AM_services|AppletResourceUserId]]. No output.
   −
The bool indicates whether the [[#BusHandle]] is valid.
+
sdknso didn't actually use this until 4.x (the RequiredMcuVersion was also updated with that version).
   −
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.
+
== SetFunctionLevel ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedFunctionLevel]], and an [[AM_services|AppletResourceUserId]]. No output.
   −
This cmd will throw an error when [[#BusType]] is invalid.
+
== 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.
   −
== IsExternalDeviceConnected ==
+
The TransferMemory is created with an user specified buffer and permission none.
Takes an input [[#BusHandle]], returns an output u8 bool.
     −
This is not used by sdknso.
+
== RunIrLedProcessor ==
 +
Takes a PID-descriptor, an [[#IrCameraHandle]], a [[#PackedIrLedProcessorConfig]] (immediately after the previous word), and an [[AM_services|AppletResourceUserId]]. No output.
   −
== Initialize ==
+
== StopImageProcessorAsync ==
Takes an input [[#BusHandle]], an u64 [[AM_services|AppletResourceUserId]], no output.
+
Takes a PID-descriptor, an [[#IrCameraHandle]], and an [[AM_services|AppletResourceUserId]]. No output.
   −
Prior to using this cmd, sdknso handles [[#GetSharedMemoryHandle|sharedmem]] mapping if not done previously.
+
== ActivateIrsensorWithFunctionLevel ==
 +
Takes a PID-descriptor, an [[#PackedFunctionLevel]], and an [[AM_services|AppletResourceUserId]]. No output.
   −
== Finalize ==
+
= irs:sys =
Takes an input [[#BusHandle]], an u64 [[AM_services|AppletResourceUserId]], no output.
+
This is "nn::irsensor::IIrSensorSystemServer".
   −
== EnableExternalDevice ==
+
{| class="wikitable" border="1"
Takes an input u8 bool, a [[#BusHandle]], an u64, an u64 [[AM_services|AppletResourceUserId]], no output.
+
|-
 +
! Cmd || Name
 +
|-
 +
| 500 || [[#SetAppletResourceUserId]]
 +
|-
 +
| 501 || [[#RegisterAppletResourceUserId]]
 +
|-
 +
| 502 || [[#UnregisterAppletResourceUserId]]
 +
|-
 +
| 503 || [[#EnableAppletToGetInput]]
 +
|}
   −
sdknso passes value 0x38900050018 (0x3A600050018 with 7.x+) for the u64.
+
== SetAppletResourceUserId ==
 +
Takes an [[AM_services|AppletResourceUserId]]. No output.
   −
The bool flag indicates whether to enable the device (true = enable, false = disable).  When false, this will use [[#DisableJoyPollingReceiveMode]] if needed.
+
== RegisterAppletResourceUserId ==
 +
Takes a bool and an [[AM_services|AppletResourceUserId]]. No output.
   −
== GetExternalDeviceId ==
+
== UnregisterAppletResourceUserId ==
Takes an input [[#BusHandle]], returns an output u32 ExternalDeviceId.
+
Takes an [[AM_services|AppletResourceUserId]]. No output.
   −
== SendCommandAsync ==
+
== EnableAppletToGetInput ==
Takes a type-0x21 input buffer and a [[#BusHandle]], no output.
+
Takes a bool and an [[AM_services|AppletResourceUserId]]. No output.
   −
== GetSendCommandAsynceResult ==
+
= ahid:cd =
Takes a type-0x22 output buffer and a [[#BusHandle]], returns an output u32.
+
This is "nn::ahid::IServerSession".
   −
Official sw copies the u32 to an output u64, for the actual output size.
+
Used for USB HID devices.
   −
== SetEventForSendCommandAsycResult ==
+
This service no longer exists in [9.0.0+].
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"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Description
+
! Cmd || Name
 
|-
 
|-
| 0x0 || 0x1 || Bool flag
+
| 0 || [[#AcquireDevice]]
 
|-
 
|-
| 0x1 || 0x3 || Padding
+
| 1 || [[#ReleaseDevice]]
 
|-
 
|-
| 0x4 || 0x4 || Result
+
| 2 || [[#GetCtrlSession]]
 
|-
 
|-
| 0x8 || 0x1 || DeviceEnabled. Bool flag indicating whether a device is [[#EnableExternalDevice|enabled]].
+
| 3 || [[#GetReadSession]]
 
|-
 
|-
| 0x9 || 0x1 || IsValid. Bool flag indicating whether this entry is valid.
+
| 4 || [1.0.0-2.3.0] [[#GetWriteSession]]
|-
  −
| 0xA || 0x1 || PollingEnabled. Bool flag indicating whether polling is [[#EnableJoyPollingReceiveMode|enabled]].
  −
|-
  −
| 0xB || 0x1 || Unknown / padding?
  −
|-
  −
| 0xC || 0x4 || [[#JoyPollingMode]]
   
|}
 
|}
   −
== EnableJoyPollingReceiveMode ==
+
== AcquireDevice ==
Takes a type-0x21 input buffer, a TransferMemory handle, an u32 tmem_size, an u32 [[#JoyPollingMode]], a [[#BusHandle]], no output.
+
Takes an input s32, no output.
 +
 
 +
== ReleaseDevice ==
 +
Takes an input s32, no output.
   −
The TransferMemory is created with an user-specified output buffer, with permissions=R--.
+
== GetCtrlSession ==
 +
Takes an input u32, returns an [[#ICtrlSession]].
   −
The content of the TransferMemory depends of the [[#JoyPollingMode]]. This is used by GetJoyPollingReceivedData. Structure of the TransferMemory (DisableSixAxisPollingDataAccessor, EnableSixAxisPollingDataAccessor, JoyButtonOnlyPollingDataAccessor):
+
== GetReadSession ==
 +
Takes an input u32, returns an [[#IReadSession]].
   −
{| class="wikitable" border="1"
+
== GetWriteSession ==
|-
+
Takes an input u32, returns an [[#IWriteSession]].
! Offset || Size || Description
  −
|-
  −
| 0x0 || 0x4 || Result.
  −
|-
  −
| 0x0 || 0x4 || Padding.
  −
|-
  −
| 0x8 || 0x18 || Initialized sysmodule-side, not used by sdknso.
  −
|-
  −
| 0x20 || 0x8 || Latest entry.
  −
|-
  −
| 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:
+
== ICtrlSession ==
 +
This is "nn::ahid::ICtrlSession".
   −
DisableSixAxisPollingDataAccessor:
+
This no longer exists in [9.0.0+].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Description
+
! Cmd || Name
 
|-
 
|-
| 0x0 || 0x26 || Data
+
| 0 || GetString
 
|-
 
|-
| 0x26 || 0x1 || Size of data.
+
| 1 || GetCodeBook
 
|-
 
|-
| 0x27 || 0x1 || Padding
+
| 2 || GetReport
 
|-
 
|-
| 0x28 || 0x8 || Timestamp
+
| 3 || SetReport
|}
  −
 
  −
JoyEnableSixAxisPollingDataAccessor:
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 4 || GetIdle
 
|-
 
|-
| 0x0 || 0x8 || Data
+
| 5 || SetIdle
 
|-
 
|-
| 0x8 || 0x1 || Size of data.
+
| 6 || GetProtocol
 
|-
 
|-
| 0x9 || 0x7 || Padding
+
| 7 || SetProtocol
 
|-
 
|-
| 0x10 || 0x8 || Timestamp
+
| 8 || GetDescriptor
|}
  −
 
  −
JoyButtonOnlyPollingDataAccessor:
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 9 || SetDescriptor
 
|-
 
|-
| 0x0 || 0x2C || Data
+
| 10 || GetStateChangeEvent
 
|-
 
|-
| 0x2C || 0x1 || Size of data.
+
| 11 || SignalStateChangeEvent
 
|-
 
|-
| 0x2D || 0x3 || Padding
+
| 12 || [3.0.0+] Write
|-
  −
| 0x30 || 0x8 || Timestamp
   
|}
 
|}
   −
== DisableJoyPollingReceiveMode ==
+
All of these use USB [[USB_services|CtrlXfer]], except for GetStateChangeEvent and SignalStateChangeEvent, and GetCodeBook which copies 0x4000-bytes from state to output.
Takes an input [[#BusHandle]], no output.
     −
== SetStatusManagerType ==
+
== IReadSession ==
Takes an input u32, no output.
+
This is "nn::ahid::IReadSession".
   −
This is used by sdknso immediately after mapping [[#GetSharedMemoryHandle|sharedmem]] (before [[#Initialize]]) with hard-coded value 0x2.
+
This no longer exists in [9.0.0+].
 
  −
= GyroscopeZeroDriftMode =
  −
This is "nn::hid::GyroscopeZeroDriftMode".
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Value
  −
!  Description
   
|-
 
|-
| 0 || Loose
+
! Cmd || Name
 
|-
 
|-
| 1 || Standard
+
| 0 || [[#Read]]
|-
  −
| 2 || Tight
   
|}
 
|}
   −
= NpadStyleTag =
+
=== Read ===
This is "nn::hid::NpadStyleTag".
+
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"
 
{| class="wikitable" border="1"
!  Bits
  −
!  Description
  −
!  Notes
   
|-
 
|-
| 0
+
! Cmd || Name
| NpadFullKey
  −
| Pro Controller
   
|-
 
|-
| 1
+
| 0 || [[#Write]]
| NpadHandheld
+
|}
| Joy-Con controller in handheld mode
+
 
|-
+
=== Write ===
| 2
+
This is the inverse of [[#IReadSession]] cmd0. Uses the OUTPUT endpoint with an input buffer.
| NpadJoyDual
+
 
| Joy-Con controller in dual mode
+
= 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
 
|-
 
|-
| 3
+
| 0 || GetDeviceEntries
| NpadJoyLeft
  −
| Joy-Con left controller in single mode
   
|-
 
|-
| 4
+
| 1 || GetDeviceList
| NpadJoyRight
  −
| Joy-Con right controller in single mode
   
|-
 
|-
| 5
+
| 2 || GetDeviceParameters
| NpadGc
  −
| GameCube controller
   
|-
 
|-
| 6
+
| 3 || AttachDevice
| NpadPalma
  −
| Poké Ball Plus controller
   
|-
 
|-
| 7
+
| 4 || DetachDevice
| NpadLark
  −
| NES/Famicom controller
   
|-
 
|-
| 8
+
| 5 || [6.0.0+] SetDeviceFilter
| NpadHandheldLark
+
|}
| NES/Famicom controller in handheld mode
+
 
 +
= xcd:sys =
 +
This is "nn::xcd::detail::ISystemServer".
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 9
+
! Cmd || Name
| NpadLucia
  −
| SNES controller
   
|-
 
|-
| 10-28
+
| 0 || GetDataFormat
| Reserved
  −
|
   
|-
 
|-
| 29
+
| 1 || SetDataFormat
| NpadSystemExt
  −
| Generic external controller
   
|-
 
|-
| 30
+
| 2 || GetMcuState
| NpadSystem
  −
| Generic controller
   
|-
 
|-
| 31
+
| 3 || SetMcuState
| 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
   
|-
 
|-
| 0x0 || No1
+
| 4 || GetMcuVersionForNfc
 
|-
 
|-
| 0x1 || No2
+
| 5 || CheckNfcDevicePower
 
|-
 
|-
| 0x2 || No3
+
| 6 || [5.0.0+] SetMcuStateImmediate
 
|-
 
|-
| 0x3 || No4
+
| 10 || SetNfcEvent
 
|-
 
|-
| 0x4 || No5
+
| 11 || GetNfcInfo
 
|-
 
|-
| 0x5 || No6
+
| 12 || StartNfcDiscovery
 
|-
 
|-
| 0x6 || No7
+
| 13 || StopNfcDiscovery
 +
|-
 +
| 14 || StartNtagRead
 +
|-
 +
| 15 || StartNtagWrite
 
|-
 
|-
| 0x7 || No8
+
| 16 || SendNfcRawData
 
|-
 
|-
| 0x10 || Other
+
| 17 || RegisterMifareKey
 
|-
 
|-
| 0x20 || Handheld
+
| 18 || ClearMifareKey
|}
  −
 
  −
= NpadInterfaceType =
  −
This is "nn::hid::NpadInterfaceType".
  −
 
  −
{| class="wikitable" border="1"
  −
!  Value
  −
!  Description
   
|-
 
|-
| 1 || Bluetooth
+
| 19 || StartMifareRead
 
|-
 
|-
| 2 || Rail
+
| 20 || StartMifareWrite
 
|-
 
|-
| 3 || USB
+
| 101 || GetAwakeTriggerReasonForLeftRail
 
|-
 
|-
| 4 || Unknown
+
| 102 || GetAwakeTriggerReasonForRightRail
 
|}
 
|}
   −
= AbstractedPadState =
+
[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"
 
|-
 
|-
! Offset || Size || Description
+
! Cmd || Name
 
|-
 
|-
| 0x0 || 0x4 || Type, only 1 bit can be set. Converted to [[#HdlsDeviceInfo]]::type internally by [[#SetAutoPilotVirtualPadState]].
+
| 1 || [[#GetBusHandle]]
 
|-
 
|-
| 0x4 || 0x1 || Flags. [[#SetAutoPilotVirtualPadState]] only uses bit0: when clear it will skip using the rest of the input and run [[#UnsetAutoPilotVirtualPadState]] internally.
+
| 2 || [[#IsExternalDeviceConnected]]
 
|-
 
|-
| 0x5 || 0x3 || Padding
+
| 3 || [[#Initialize]]
 
|-
 
|-
| 0x8 || 0x4 || RGBA Single Body Color
+
| 4 || [[#Finalize]]
 
|-
 
|-
| 0xC || 0x4 || RGBA Single Buttons Color
+
| 5 || [[#EnableExternalDevice]]
 
|-
 
|-
| 0x10 || 0x1 || See [[#HiddbgHdlsDeviceInfo]]::[[#NpadInterfaceType]].
+
| 6 || [[#GetExternalDeviceId]]
 
|-
 
|-
| 0x11 || 0x3 || Padding
+
| 7 || [[#SendCommandAsync]]
 
|-
 
|-
| 0x14 || 0x24 || [[#HdlsState]]. Unknown if the last 4-bytes are included in this struct, [[#SetAutoPilotVirtualPadState]]/[[#hiddbgGetAbstractedPadsState]] only uses the first 0x20-bytes.
+
| 8 || [[#GetSendCommandAsynceResult]]
 
|-
 
|-
| 0x38 || 0x60 || Unused with [[#SetAutoPilotVirtualPadState]]/[[#GetAbstractedPadsState]].
+
| 9 || [[#SetEventForSendCommandAsycResult]]
|}
  −
 
  −
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.
  −
 
  −
Type:
  −
{| class="wikitable" border="1"
  −
!  Bits
  −
[[#HdlsDeviceInfo]]::type bits
  −
!  Description
  −
!  Notes
   
|-
 
|-
| 0 || 0 || ||  
+
| 10 || [[#GetSharedMemoryHandle]]
 
|-
 
|-
| 1 || 15 || || [[#DeviceType]] |= BIT(1)
+
| 11 || [[#EnableJoyPollingReceiveMode]]
 
|-
 
|-
| 2 || 1 || ||  
+
| 12 || [[#DisableJoyPollingReceiveMode]]
 
|-
 
|-
| 3 || 2 || ||
+
| 13 || [5.0.0-6.2.0] GetPollingData
 
|-
 
|-
| 4 || 1 || ||
+
| 14 || [6.0.0+] [[#SetStatusManagerType]]
|-
+
|}
| 5 || 2 || ||
  −
|-
  −
| 6 || 3 || ||
  −
|-
  −
| 7 || 11 || || [[#DeviceType]] |= BIT(11)
  −
|-
  −
| 8 || 12 || || [[#DeviceType]] |= BIT(12)
  −
|-
  −
| 9 || 13 || || [[#DeviceType]] |= BIT(13)
  −
|-
  −
| 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)
  −
|-
  −
|}
     −
The above "[[#DeviceType]] |=" notes only apply when type2 is 0x2.
+
sdknso doesn't use the GetPollingData cmd.
   −
= HdlsNpadAssignment =
+
== GetBusHandle ==
This is a 0x208-byte struct.
+
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
  −
|-
  −
| 0x0 || 0x4 || s32 Total entries
  −
|-
  −
| 0x4 || 0x4 || Padding
  −
|-
  −
| 0x8 || 0x200(0x20*0x10) || Array of [[#HdlsNpadAssignmentEntry]].
  −
|}
     −
= HdlsNpadAssignmentEntry =
+
== IsExternalDeviceConnected ==
This is a 0x20-byte struct.
+
Takes an input [[#BusHandle]], returns an output u8 bool.
   −
{| class="wikitable" border="1"
+
This is not used by sdknso.
|-
+
 
! Offset || Size || Description
+
== Initialize ==
|-
+
Takes an input [[#BusHandle]], an u64 [[AM_services|AppletResourceUserId]], no output.
| 0x0 || 0x8 || HdlsHandle
  −
|-
  −
| 0x8 || 0x4 || ?
  −
|-
  −
| 0xC || 0x4 || ?
  −
|-
  −
| 0x10 || 0x8 || ?
  −
|-
  −
| 0x18 || 0x1 || ?
  −
|-
  −
| 0x19 || 0x7 || Padding
  −
|}
     −
= HdlsStateList =
+
Prior to using this cmd, sdknso handles [[#GetSharedMemoryHandle|sharedmem]] mapping if not done previously.
This is a 0x408-byte struct.
     −
[9.0.0+] This is a 0x488-byte struct.
+
== Finalize ==
 +
Takes an input [[#BusHandle]], an u64 [[AM_services|AppletResourceUserId]], no output.
   −
{| class="wikitable" border="1"
+
== EnableExternalDevice ==
|-
+
Takes an input u8 bool, a [[#BusHandle]], an u64, an u64 [[AM_services|AppletResourceUserId]], no output.
! Offset || Size || Description
+
 
|-
+
sdknso passes value 0x38900050018 (0x3A600050018 with 7.x+) for the u64.
| 0x0 || 0x4 || s32 Total entries
+
 
|-
+
The bool flag indicates whether to enable the device (true = enable, false = disable).  When false, this will use [[#DisableJoyPollingReceiveMode]] if needed.
| 0x4 || 0x4 || Padding
  −
|-
  −
| 0x8 || <[[#HdlsStateListEntry]] size>*0x10 || Array of [[#HdlsStateListEntry]].
  −
|}
     −
This contains a list of all controllers, including non-virtual controllers.
+
== GetExternalDeviceId ==
 +
Takes an input [[#BusHandle]], returns an output u32 ExternalDeviceId.
   −
= HdlsStateListEntry =
+
== SendCommandAsync ==
This is a 0x40-byte struct.  
+
Takes a type-0x21 input buffer and a [[#BusHandle]], no output.
   −
[9.0.0+] This is a 0x48-byte struct.
+
== GetSendCommandAsynceResult ==
 +
Takes a type-0x22 output buffer and a [[#BusHandle]], returns an output u32.
   −
{| class="wikitable" border="1"
+
Official sw copies the u32 to an output u64, for the actual output size.
|-
+
 
! Offset || Size || Description
+
== SetEventForSendCommandAsycResult ==
|-
+
Takes an input [[#BusHandle]], returns an output Event handle with EventClearMode=0.
| 0x0 || 0x8 || HdlsHandle
+
 
|-
+
Official sw with SendAndReceive clears this event (6.x+ sdknso), uses [[#SendCommandAsync]], waits on + clears this event, then uses [[#GetSendCommandAsynceResult]].
| 0x8 || [[#HdlsDeviceInfo]] size || [[#HdlsDeviceInfo]]. With [[#ApplyHdlsStateList]] this is only used when creating new devices.
+
 
|-
+
== GetSharedMemoryHandle ==
| 0x8 + [[#HdlsDeviceInfo]] size, with 8-byte alignment || 0x24 || [[#HdlsState]]
+
No input, returns an output SharedMemory handle.
|-
+
 
| <Immediately following the above> || 0x4 || Padding
+
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]]}.
   −
= HdlsDeviceInfo =
+
sdknso only uses the first 0x10-bytes of these entries, the rest is the ignored. Entry structure:
This is a 0x10-byte struct.
      
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,928: Line 1,878:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x4 || [[#DeviceTypeInternal]]
+
| 0x0 || 0x1 || Bool flag
 
|-
 
|-
| 0x4 || 0x4 || RGBA Single Body Color
+
| 0x1 || 0x3 || Padding
 +
|-
 +
| 0x4 || 0x4 || Result
 +
|-
 +
| 0x8 || 0x1 || DeviceEnabled. Bool flag indicating whether a device is [[#EnableExternalDevice|enabled]].
 +
|-
 +
| 0x9 || 0x1 || IsValid. Bool flag indicating whether this entry is valid.
 
|-
 
|-
| 0x8 || 0x4 || RGBA Single Buttons Color
+
| 0xA || 0x1 || PollingEnabled. Bool flag indicating whether polling is [[#EnableJoyPollingReceiveMode|enabled]].
 
|-
 
|-
| 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.
+
| 0xB || 0x1 || Unknown / padding?
 
|-
 
|-
| 0xD || 0x3 || Padding
+
| 0xC || 0x4 || [[#JoyPollingMode]]
 
|}
 
|}
   −
[9.0.0+] This is a 0x14-byte struct.
+
== 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"
 
{| class="wikitable" border="1"
Line 1,945: Line 1,906:  
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x1 || [[#DeviceTypeInternal]]
+
| 0x0 || 0x4 || Result.
 
|-
 
|-
| 0x1 || 0x1 || [[#NpadInterfaceType]]. Similar to the field from the old struct.
+
| 0x0 || 0x4 || Padding.
 
|-
 
|-
| 0x2 || 0x2 || Padding
+
| 0x8 || 0x18 || Initialized sysmodule-side, not used by sdknso.
 
|-
 
|-
| 0x4 || 0x4 || RGBA Single Body Color
+
| 0x20 || 0x8 || Latest entry.
 
|-
 
|-
| 0x8 || 0x4 || RGBA Single Buttons Color
+
| 0x28 || 0x8 || Total entries.
|-
  −
| 0xC || 0x4 || RGBA Unknown Body Color
  −
|-
  −
| 0x10 || 0x4 || RGBA Unknown Buttons Color
   
|}
 
|}
   −
= DeviceTypeInternal =
+
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:
This is "nn::hid::detail::DeviceTypeInternal".
+
 
 +
DisableSixAxisPollingDataAccessor:
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Bits
  −
!  Description
   
|-
 
|-
| 0-7
+
! Offset || Size || Description
| BIT(N*4+0) = Pro Controller, BIT(N*4+1) = Joy-Con Left, BIT(N*4+2) = Joy-Con Right, BIT(N*4+3) = invalid. Where N is 0-1.
   
|-
 
|-
| 8-10
+
| 0x0 || 0x26 || Data
| Pro Controller
   
|-
 
|-
| 11
+
| 0x26 || 0x1 || Size of data.
| Famicom left controller
   
|-
 
|-
| 12
+
| 0x27 || 0x1 || Padding
| Famicom right controller (with microphone)
   
|-
 
|-
| 13
+
| 0x28 || 0x8 || Timestamp
| NES left controller
+
|}
 +
 
 +
JoyEnableSixAxisPollingDataAccessor:
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 14
+
! Offset || Size || Description
| NES right controller
   
|-
 
|-
| 15-16
+
| 0x0 || 0x8 || Data
| Invalid
   
|-
 
|-
| 17
+
| 0x8 || 0x1 || Size of data.
| Generic external controller
   
|-
 
|-
| 18-20
+
| 0x9 || 0x7 || Padding
| Invalid
   
|-
 
|-
| 21-23
+
| 0x10 || 0x8 || Timestamp
| Generic controller
   
|}
 
|}
   −
[9.0.0+] This is "nn::hidtypes::DeviceType".
+
JoyButtonOnlyPollingDataAccessor:
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Value
  −
!  [[#DeviceType|DeviceType]]
  −
!  [[#UniquePadType|UniquePadType]]
  −
!  Description
   
|-
 
|-
| 1 || JoyRight, HandheldRight || JoyRight || Joy-Con right controller
+
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x2C || Data
 
|-
 
|-
| 2 || JoyLeft, HandheldLeft || JoyLeft || Joy-Con left controller
+
| 0x2C || 0x1 || Size of data.
 
|-
 
|-
| 3 || FullKey || FullKey || Pro Controller
+
| 0x2D || 0x3 || Padding
 
|-
 
|-
| 4 || JoyLeft || JoyLeft || Reserved
+
| 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
 
|-
 
|-
| 5 || JoyRight || JoyRight || Reserved
+
| 0 || Loose
 
|-
 
|-
| 6 || FullKey || FullKey || Reserved
+
| 1 || Standard
 
|-
 
|-
| 7 || LarkHvcLeft, HandheldLarkHvcLeft || JoyLeft || Famicom left controller
+
| 2 || Tight
 +
|}
 +
 
 +
= NpadStyleTag =
 +
This is "nn::hid::NpadStyleTag".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Bits
 +
!  Description
 +
!  Notes
 
|-
 
|-
| 8 || LarkHvcRight, HandheldLarkHvcRight || JoyRight || Famicom right controller (with microphone)
+
| 0
 +
| NpadFullKey
 +
| Pro Controller
 
|-
 
|-
| 9 || LarkNesLeft, HandheldLarkNesLeft || JoyLeft || NES left controller
+
| 1
 +
| NpadHandheld
 +
| Joy-Con controller in handheld mode
 
|-
 
|-
| 10 || LarkNesRight, HandheldLarkNesRight || JoyRight || NES right controller
+
| 2
 +
| NpadJoyDual
 +
| Joy-Con controller in dual mode
 
|-
 
|-
| 11 || Lucia || FullKey || SNES controller
+
| 3
 +
| NpadJoyLeft
 +
| Joy-Con left controller in single mode
 
|-
 
|-
| 12 || Palma || Other || Poké Ball Plus controller
+
| 4
 +
| NpadJoyRight
 +
| Joy-Con right controller in single mode
 
|-
 
|-
| 13 || FullKey || FullKey || Gc controller
+
| 5
 +
| NpadGc
 +
| GameCube controller
 
|-
 
|-
| 14 || HandheldLeft || JoyLeft || Reserved
+
| 6
 +
| NpadPalma
 +
| Poké Ball Plus controller
 
|-
 
|-
| 15 || FullKey || FullKey || Reserved
+
| 7
 +
| NpadLark
 +
| NES/Famicom controller
 
|-
 
|-
| 16 || FullKey || FullKey || Reserved
+
| 8
 +
| NpadHandheldLark
 +
| NES/Famicom controller in handheld mode
 
|-
 
|-
| 17 || DebugPad || DebugPad || Debug controller
+
| 9
 +
| NpadLucia
 +
| SNES controller
 
|-
 
|-
| 18 || HandheldRight || JoyRight || Reserved
+
| 10-28
 +
| Reserved
 +
|
 
|-
 
|-
| 19 || System || Other || Unknown (has [[#NpadStyleTag|NpadFullKey]] style tag)
+
| 29
 +
| NpadSystemExt
 +
| Generic external controller
 
|-
 
|-
| 20 || System || Other || Unknown (has [[#NpadStyleTag|NpadJoyDual]] style tag)
+
| 30
 +
| NpadSystem
 +
| Generic controller
 
|-
 
|-
| 21 || System || Other || Unknown (has [[#NpadStyleTag|NpadJoyDual]] style tag)
+
| 31
 +
| Reserved
 +
|
 
|}
 
|}
   −
= HdlsState =
+
= NpadIdType =
This is a 0x24-byte struct.
+
This is "nn::hid::NpadIdType". This is the controller index used in [[HID_Shared_Memory#Controllers|sharedmem]].
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 
|-
 
|-
! Offset || Size || Description
+
| 0x0 || No1
 
|-
 
|-
| 0x0 || 0x1 || powerConnected for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
+
| 0x1 || No2
 
|-
 
|-
| 0x1 || 0x1 || ORRed with powerConnected to set the value of the first byte for the controller [[HID_Shared_Memory#Flags|flags]].
+
| 0x2 || No3
 +
|-
 +
| 0x3 || No4
 
|-
 
|-
| 0x2 || 0x6 || Unknown
+
| 0x4 || No5
 
|-
 
|-
| 0x8 || 0x4 || batteryCharge for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
+
| 0x5 || No6
 
|-
 
|-
| 0xC || 0x4 || [[HID_Shared_Memory#Button_State|Buttons]]. Bit18 = HOME and bit19 = Capture.
+
| 0x6 || No7
 
|-
 
|-
| 0x10 || 0x10(4*2*2) || Joystick data, see [[HID_Shared_Memory#Controller_State]].
+
| 0x7 || No8
 
|-
 
|-
| 0x20 || 0x1 || Unused for input. Set with output from [[#DumpHdlsStates]] (zero in some cases).
+
| 0x10 || Other
 
|-
 
|-
| 0x21 || 0x3 || Padding
+
| 0x20 || Handheld
 
|}
 
|}
   −
[9.0.0+]:
+
= NpadInterfaceType =
 +
This is "nn::hid::NpadInterfaceType".
 +
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 
|-
 
|-
! Offset || Size || Description
+
| 1 || Bluetooth
 
|-
 
|-
| 0x0 || 0x4 || batteryCharge for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
+
| 2 || Rail
 
|-
 
|-
| 0x4 || 0x4 || Unknown
+
| 3 || USB
 
|-
 
|-
| 0x8 || 0x8 || [[HID_Shared_Memory#Button_State|Buttons]], masked with 0xfffffffff00fffff. See above table regarding HOME/Capture buttons.
+
| 4 || Unknown
|-
  −
| 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 =
+
= AbstractedPadState =
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Offset || Size || Subcommand argdata bytepos || Subcommand argdata nibble || Description
+
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x1 || 0x0 || Low || Mini Cycle Base Duration. Value 0x1-0xF: 12.5ms - 187.5ms. Value 0x0 = 0ms/OFF.
+
| 0x0 || 0x4 || Type, only 1 bit can be set. Converted to [[#HdlsDeviceInfo]]::type internally by [[#SetAutoPilotVirtualPadState]].
 
|-
 
|-
| 0x1 || 0x1 || 0x0 || High || Number of Mini Cycles + 1. Value 0x0-0xF: 1 - 16 mini cycles.
+
| 0x4 || 0x1 || Flags. [[#SetAutoPilotVirtualPadState]] only uses bit0: when clear it will skip using the rest of the input and run [[#UnsetAutoPilotVirtualPadState]] internally.
 
|-
 
|-
| 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.
+
| 0x5 || 0x3 || Padding
 
|-
 
|-
| 0x3 || 0x1 || 0x1 || High || LED Start Intensity. Value 0x0-0xF: 0% - 100%. (In HW, 1 - 241 duty)
+
| 0x8 || 0x4 || RGBA Single Body Color
 
|-
 
|-
| 0x4 || 0x1 || 0x2 || High || Mini Cycle 1 LED Intensity. Value 0x0-0xF: 0% - 100%. (In HW, 1 - 241 duty)
+
| 0xC || 0x4 || RGBA Single Buttons Color
 
|-
 
|-
| 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.
+
| 0x10 || 0x1 || See [[#HiddbgHdlsDeviceInfo]]::[[#NpadInterfaceType]].
 
|-
 
|-
| 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.
+
| 0x11 || 0x3 || Padding
 
|-
 
|-
| 0x7 || 0x1 || || || Unused
+
| 0x14 || 0x24 || [[#HdlsState]]. Unknown if the last 4-bytes are included in this struct, [[#SetAutoPilotVirtualPadState]]/[[#hiddbgGetAbstractedPadsState]] only uses the first 0x20-bytes.
 
|-
 
|-
| 0x8 || 0x1 || 0x2 || Low || Mini Cycle 2 LED Intensity.
+
| 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.
 +
 
 +
Type:
 +
{| class="wikitable" border="1"
 +
!  Bits
 +
!  [[#HdlsDeviceInfo]]::type bits
 +
!  Description
 +
!  Notes
 
|-
 
|-
| 0x9 || 0x1 || 0x4 || High || Fading Transition Steps to Mini Cycle 2 (see above).
+
| 0 || 0 || ||  
 
|-
 
|-
| 0xA || 0x1 || 0x4 || Low || Final Step Duration Multiplier of Mini Cycle 2 (see above).
+
| 1 || 15 || || [[#DeviceType]] |= BIT(1)
 
|-
 
|-
| 0xB || 0x1 || || || Unused
+
| 2 || 1 || ||  
 
|-
 
|-
| 0xC || 0x1 || 0x5 || High || Mini Cycle 3 LED Intensity.
+
| 3 || 2 || ||  
 
|-
 
|-
| 0xD || 0x1 || 0x6 || High || Fading Transition Steps to Mini Cycle 3 (see above).
+
| 4 || 1 || ||  
 
|-
 
|-
| 0xE || 0x1 || 0x6 || Low || Final Step Duration Multiplier of Mini Cycle 3 (see above).
+
| 5 || 2 || ||  
 
|-
 
|-
| 0xF || 0x1 || || || Unused
+
| 6 || 3 || ||  
 
|-
 
|-
| 0x10 || 0x1 || 0x5 || Low || Mini Cycle 4 LED Intensity.
+
| 7 || 11 || || [[#DeviceType]] |= BIT(11)
 
|-
 
|-
| 0x11 || 0x1 || 0x7 || High || Fading Transition Duration to Mini Cycle 4 (see above).
+
| 8 || 12 || || [[#DeviceType]] |= BIT(12)
 
|-
 
|-
| 0x12 || 0x1 || 0x7 || Low || Final Step Duration Multiplier of Mini Cycle 4 (see above).
+
| 9 || 13 || || [[#DeviceType]] |= BIT(13)
 
|-
 
|-
| 0x13 || 0x1 || || || Unused
+
| 10 || 14 || || [[#DeviceType]] |= BIT(14)
 
|-
 
|-
| 0x14 || 0x1 || 0x8 || High || Mini Cycle 5 LED Intensity.
+
| 11 || 15 || || [[#DeviceType]] |= BIT(11)
 
|-
 
|-
| 0x15 || 0x1 || 0x9 || High || Fading Transition Steps to Mini Cycle 5 (see above).
+
| 12 || 12 || || [[#DeviceType]] |= BIT(12)
 
|-
 
|-
| 0x16 || 0x1 || 0x9 || Low || Final Step Duration Multiplier of Mini Cycle 5 (see above).
+
| 13 || 13 || || [[#DeviceType]] |= BIT(13)
 
|-
 
|-
| 0x17 || 0x1 || || || Unused
+
| 14 || 14 || || [[#DeviceType]] |= BIT(14)
 
|-
 
|-
| 0x18 || 0x1 || 0x8 || Low || Mini Cycle 6 LED Intensity.
+
| 15 || 17 || ||  
 
|-
 
|-
| 0x19 || 0x1 || 0xA || High || Fading Transition Steps to Mini Cycle 6 (see above).
+
| 31 || 21 || || [[#DeviceType]] = BIT(31)
 
|-
 
|-
| 0x1A || 0x1 || 0xA || Low || Final Step Duration Multiplier of Mini Cycle 6 (see above).
+
|}
|-
+
 
| 0x1B || 0x1 || || || Unused
+
The above "[[#DeviceType]] |=" notes only apply when type2 is 0x2.
 +
 
 +
= HdlsNpadAssignment =
 +
This is a 0x208-byte struct.
 +
 
 +
{| 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 || 0x4 || s32 Total entries
 
|-
 
|-
| 0x1E || 0x1 || 0xC || Low || Final Step Duration Multiplier of Mini Cycle 7 (see above).
+
| 0x4 || 0x4 || Padding
 
|-
 
|-
| 0x1F || 0x1 || || || Unused
+
| 0x8 || 0x200(0x20*0x10) || Array of [[#HdlsNpadAssignmentEntry]].
 +
|}
 +
 
 +
= HdlsNpadAssignmentEntry =
 +
This is a 0x20-byte struct.
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x20 || 0x1 || 0xB || Low || Mini Cycle 8 LED Intensity.
+
! Offset || Size || Description
 
|-
 
|-
| 0x21 || 0x1 || 0xD || Low || Fading Transition Steps to Mini Cycle 8 (see above).
+
| 0x0 || 0x8 || HdlsHandle
 
|-
 
|-
| 0x22 || 0x1 || 0xD || High || Final Step Duration Multiplier of Mini Cycle 8 (see above).
+
| 0x8 || 0x4 || ?
 
|-
 
|-
| 0x23 || 0x1 || || || Unused
+
| 0xC || 0x4 || ?
 
|-
 
|-
| 0x24 || 0x1 || 0xE || High || Mini Cycle 9 LED Intensity.
+
| 0x10 || 0x8 || ?
 
|-
 
|-
| 0x25 || 0x1 || 0xF || High || Fading Transition Steps to Mini Cycle 9 (see above).
+
| 0x18 || 0x1 || ?
 
|-
 
|-
| 0x26 || 0x1 || 0xF || Low || Final Step Duration Multiplier of Mini Cycle 9 (see above).
+
| 0x19 || 0x7 || Padding
 +
|}
 +
 
 +
= HdlsStateList =
 +
This is a 0x408-byte struct.
 +
 
 +
[9.0.0+] This is a 0x488-byte struct.
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x27 || 0x1 || || || Unused
+
! Offset || Size || Description
 
|-
 
|-
| 0x28 || 0x1 || 0xE || Low || Mini Cycle 10 LED Intensity.
+
| 0x0 || 0x4 || s32 Total entries
 
|-
 
|-
| 0x29 || 0x1 || 0x10 || High || Fading Transition Steps to Mini Cycle 10 (see above).
+
| 0x4 || 0x4 || Padding
 
|-
 
|-
| 0x2A || 0x1 || 0x10 || Low || Final Step Duration Multiplier of Mini Cycle 10 (see above).
+
| 0x8 || <[[#HdlsStateListEntry]] size>*0x10 || Array of [[#HdlsStateListEntry]].
|-
+
|}
| 0x2B || 0x1 || || || Unused
+
 
 +
This contains a list of all controllers, including non-virtual controllers.
 +
 
 +
= HdlsStateListEntry =
 +
This is a 0x40-byte struct.  
 +
 
 +
[9.0.0+] This is a 0x48-byte struct.
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x2C || 0x1 || 0x11 || High || Mini Cycle 11 LED Intensity.
+
! Offset || Size || Description
 
|-
 
|-
| 0x2D || 0x1 || 0x12 || High || Fading Transition Steps to Mini Cycle 11 (see above).
+
| 0x0 || 0x8 || HdlsHandle
 
|-
 
|-
| 0x2E || 0x1 || 0x12 || Low || Final Step Duration Multiplier of Mini Cycle 11 (see above).
+
| 0x8 || [[#HdlsDeviceInfo]] size || [[#HdlsDeviceInfo]]. With [[#ApplyHdlsStateList]] this is only used when creating new devices.
 
|-
 
|-
| 0x2F || 0x1 || || || Unused
+
| 0x8 + [[#HdlsDeviceInfo]] size, with 8-byte alignment || 0x24 || [[#HdlsState]]
 
|-
 
|-
| 0x30 || 0x1 || 0x11 || Low || Mini Cycle 12 LED Intensity.
+
| <Immediately following the above> || 0x4 || Padding
 +
|}
 +
 
 +
= HdlsDeviceInfo =
 +
This is a 0x10-byte struct.
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x31 || 0x1 || 0x13 || High || Fading Transition Steps to Mini Cycle 12 (see above).
+
! Offset || Size || Description
 
|-
 
|-
| 0x32 || 0x1 || 0x13 || Low || Final Step Duration Multiplier of Mini Cycle 12 (see above).
+
| 0x0 || 0x4 || [[#DeviceTypeInternal]]
 
|-
 
|-
| 0x33 || 0x1 || || || Unused
+
| 0x4 || 0x4 || RGBA Single Body Color
 
|-
 
|-
| 0x34 || 0x1 || 0x14 || High || Mini Cycle 13 LED Intensity.
+
| 0x8 || 0x4 || RGBA Single Buttons Color
 
|-
 
|-
| 0x35 || 0x1 || 0x15 || High || Fading Transition Steps to Mini Cycle 13 (see above).
+
| 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.
 
|-
 
|-
| 0x36 || 0x1 || 0x15 || Low || Final Step Duration Multiplier of Mini Cycle 13 (see above).
+
| 0xD || 0x3 || Padding
 +
|}
 +
 
 +
[9.0.0+] This is a 0x14-byte struct.
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x37 || 0x1 || || || Unused
+
! Offset || Size || Description
 
|-
 
|-
| 0x38 || 0x1 || 0x14 || Low || Mini Cycle 14 LED Intensity.
+
| 0x0 || 0x1 || [[#DeviceTypeInternal]]
 
|-
 
|-
| 0x39 || 0x1 || 0x16 || High || Fading Transition Steps to Mini Cycle 14 (see above).
+
| 0x1 || 0x1 || [[#NpadInterfaceType]]. Similar to the field from the old struct.
 
|-
 
|-
| 0x3A || 0x1 || 0x16 || Low || Final Step Duration Multiplier of Mini Cycle 14 (see above).
+
| 0x2 || 0x2 || Padding
 
|-
 
|-
| 0x3B || 0x1 || || || Unused
+
| 0x4 || 0x4 || RGBA Single Body Color
 
|-
 
|-
| 0x3C || 0x1 || 0x17 || High || Mini Cycle 15 LED Intensity.
+
| 0x8 || 0x4 || RGBA Single Buttons Color
 
|-
 
|-
| 0x3D || 0x1 || 0x18 || High || Fading Transition Steps to Mini Cycle 15 (see above).
+
| 0xC || 0x4 || RGBA Unknown Body Color
 
|-
 
|-
| 0x3E || 0x1 || 0x18 || Low || Final Step Duration Multiplier of Mini Cycle 15 (see above).
+
| 0x10 || 0x4 || RGBA Unknown Buttons Color
 +
|}
 +
 
 +
= DeviceTypeInternal =
 +
This is "nn::hid::detail::DeviceTypeInternal".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Bits
 +
!  Description
 
|-
 
|-
| 0x3F || 0x1 || || || Unused
+
| 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.
 
|-
 
|-
| 0x40 || 0x1 || 0x17 || Low || Mini Cycle 16 LED Intensity.
+
| 8-10
 +
| Pro Controller
 
|-
 
|-
| 0x41 || 0x1 || 0x19 || High || Fading Transition Steps to Mini Cycle 16 (see above). (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
+
| 11
 +
| Famicom left controller
 
|-
 
|-
| 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.)
+
| 12
 +
| Famicom right controller (with microphone)
 
|-
 
|-
| 0x43 || 0x1 || || || Unused
+
| 13
 +
| NES left controller
 
|-
 
|-
| 0x44 || 0x1 || 0x1A || High || Unknown (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
+
| 14
 +
| NES right controller
 
|-
 
|-
| 0x45 || 0x1 || 0x1A || Low || Unknown (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
+
| 15-16
 +
| Invalid
 
|-
 
|-
| 0x46 || 0x1 || || || Padding
+
| 17
 +
| Generic external controller
 
|-
 
|-
| 0x47 || 0x1 || || || Padding
+
| 18-20
 +
| Invalid
 
|-
 
|-
 +
| 21-23
 +
| Generic controller
 
|}
 
|}
   −
This is "nn::hid::system::NotificationLedPattern".
+
[9.0.0+] This is "nn::hidtypes::DeviceType".
   −
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"
 
{| class="wikitable" border="1"
 +
!  Value
 +
!  [[#DeviceType|DeviceType]]
 +
!  [[#UniquePadType|UniquePadType]]
 +
!  Description
 
|-
 
|-
! Offset || Size || Description
+
| 1 || JoyRight, HandheldRight || JoyRight || Joy-Con right controller
 
|-
 
|-
| 0x0 || 0x1B || See above.
+
| 2 || JoyLeft, HandheldLeft || JoyLeft || Joy-Con left controller
 
|-
 
|-
| 0x1B || 0xB || Cleared to zero.
+
| 3 || FullKey || FullKey || Pro Controller
 
|-
 
|-
| 0x26 || 0x5 || Unused
+
| 4 || JoyLeft || JoyLeft || Reserved
 
|-
 
|-
| 0x2B || 0x8 || Set to an input value, which is hard-coded 0.
+
| 5 || JoyRight || JoyRight || Reserved
 
|-
 
|-
| 0x33 || 0x2 || Set to value 0.
+
| 6 || FullKey || FullKey || Reserved
 
|-
 
|-
| 0x35 || 0x1 || Set to value 1.
+
| 7 || LarkHvcLeft, HandheldLarkHvcLeft || JoyLeft || Famicom left controller
|}
  −
 
  −
= DeviceType =
  −
This is "nn::hid::system::DeviceType".
  −
 
  −
{| class="wikitable" border="1"
  −
!  Bits
  −
!  Description
   
|-
 
|-
| 0
+
| 8 || LarkHvcRight, HandheldLarkHvcRight || JoyRight || Famicom right controller (with microphone)
| FullKey
   
|-
 
|-
| 1
+
| 9 || LarkNesLeft, HandheldLarkNesLeft || JoyLeft || NES left controller
| DebugPad
   
|-
 
|-
| 2
+
| 10 || LarkNesRight, HandheldLarkNesRight || JoyRight || NES right controller
| HandheldLeft
   
|-
 
|-
| 3
+
| 11 || Lucia || FullKey || SNES controller
| HandheldRight
   
|-
 
|-
| 4
+
| 12 || Palma || Other || Poké Ball Plus controller
| JoyLeft
   
|-
 
|-
| 5
+
| 13 || FullKey || FullKey || Gc controller
| JoyRight
   
|-
 
|-
| 6
+
| 14 || HandheldLeft || JoyLeft || Reserved
| Palma
   
|-
 
|-
| 7
+
| 15 || FullKey || FullKey || Reserved
| LarkHvcLeft
   
|-
 
|-
| 8
+
| 16 || FullKey || FullKey || Reserved
| LarkHvcRight
   
|-
 
|-
| 9
+
| 17 || DebugPad || DebugPad || Debug controller
| LarkNesLeft
   
|-
 
|-
| 10
+
| 18 || HandheldRight || JoyRight || Reserved
| LarkNesRight
   
|-
 
|-
| 11
+
| 19 || System || Other || Unknown (has [[#NpadStyleTag|NpadFullKey]] style tag)
| HandheldLarkHvcLeft
   
|-
 
|-
| 12
+
| 20 || System || Other || Unknown (has [[#NpadStyleTag|NpadJoyDual]] style tag)
| HandheldLarkHvcRight
   
|-
 
|-
| 13
+
| 21 || System || Other || Unknown (has [[#NpadStyleTag|NpadJoyDual]] style tag)
| HandheldLarkNesLeft
  −
|-
  −
| 14
  −
| HandheldLarkNesRight
  −
|-
  −
| 15
  −
| Lucia
  −
|-
  −
| 16-30
  −
| Reserved
  −
|-
  −
| 31
  −
| System
   
|}
 
|}
   −
= UniquePadType =
+
= HdlsState =
This is "nn::hid::system::UniquePadType".
+
This is a 0x24-byte struct.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
!  Value
  −
!  Description
   
|-
 
|-
| 0x0 || Other
+
! Offset || Size || Description
 +
|-
 +
| 0x0 || 0x1 || powerConnected for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
 +
|-
 +
| 0x1 || 0x1 || ORRed with powerConnected to set the value of the first byte for the controller [[HID_Shared_Memory#Flags|flags]].
 +
|-
 +
| 0x2 || 0x6 || Unknown
 +
|-
 +
| 0x8 || 0x4 || batteryCharge for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
 
|-
 
|-
| 0x1 || FullKey
+
| 0xC || 0x4 || [[HID_Shared_Memory#Button_State|Buttons]]. Bit18 = HOME and bit19 = Capture.
 
|-
 
|-
| 0x2 || JoyRight
+
| 0x10 || 0x10(4*2*2) || Joystick data, see [[HID_Shared_Memory#Controller_State]].
 
|-
 
|-
| 0x3 || JoyLeft
+
| 0x20 || 0x1 || Unused for input. Set with output from [[#DumpHdlsStates]] (zero in some cases).
 
|-
 
|-
| 0x4 || DebugPad
+
| 0x21 || 0x3 || Padding
 
|}
 
|}
   −
= IrCameraHandle =
+
[9.0.0+]:
This is "nn::irsensor::IrCameraHandle". This is an u32.
  −
 
  −
= PackedMomentProcessorConfig =
  −
This is "nn::irsensor::PackedMomentProcessorConfig". This is a 0x20-byte struct.
  −
 
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x8 || ExposureTime (default is 0x493E0)
+
| 0x0 || 0x4 || batteryCharge for the main [[HID_Shared_Memory#Controllers|PowerInfo]].
 
|-
 
|-
| 0x8 || 0x1 || LightTarget (default is 0)
+
| 0x4 || 0x4 || Unknown
 
|-
 
|-
| 0x9 || 0x1 || Gain (default is 0x8)
+
| 0x8 || 0x8 || [[HID_Shared_Memory#Button_State|Buttons]], masked with 0xfffffffff00fffff. See above table regarding HOME/Capture buttons.
 
|-
 
|-
| 0xA || 0x1 || IsNegativeImageUsed (default is 0)
+
| 0x10 || 0x10(4*2*2) || Joystick data, see [[HID_Shared_Memory#Controller_State]].
 
|-
 
|-
| 0xB || 0x5 || Padding
+
| 0x20 || 0x1 || Unused for input. Set with output from [[#DumpHdlsStates]] (zero in some cases).
 
|-
 
|-
| 0x10 || 0x2 || WindowOfInterestX (default is 0)
+
| 0x21 || 0x3 || Padding
 +
|}
 +
 
 +
= NotificationLedPattern =
 +
{| class="wikitable" border="1"
 
|-
 
|-
| 0x12 || 0x2 || WindowOfInterestY (default is 0)
+
! Offset || Size || Subcommand argdata bytepos || Subcommand argdata nibble || Description
 
|-
 
|-
| 0x14 || 0x2 || WindowOfInterestWidth (default is 0x140)
+
| 0x0 || 0x1 || 0x0 || Low || Mini Cycle Base Duration. Value 0x1-0xF: 12.5ms - 187.5ms. Value 0x0 = 0ms/OFF.
 
|-
 
|-
| 0x16 || 0x2 || WindowOfInterestHeight (default is 0xF0)
+
| 0x1 || 0x1 || 0x0 || High || Number of Mini Cycles + 1. Value 0x0-0xF: 1 - 16 mini cycles.
 
|-
 
|-
| 0x18 || 0x4 || Unknown (always 0xA0003)
+
| 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.
 
|-
 
|-
| 0x1C || 0x1 || Preprocess (default is 0x1)
+
| 0x3 || 0x1 || 0x1 || High || LED Start Intensity. Value 0x0-0xF: 0% - 100%. (In HW, 1 - 241 duty)
 
|-
 
|-
| 0x1D || 0x1 || PreprocessIntensityThreshold (default is 0x50)
+
| 0x4 || 0x1 || 0x2 || High || Mini Cycle 1 LED Intensity. Value 0x0-0xF: 0% - 100%. (In HW, 1 - 241 duty)
 
|-
 
|-
| 0x1E || 0x2 || Padding
+
| 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.
|}
  −
 
  −
= PackedClusteringProcessorConfig =
  −
This is "nn::irsensor::PackedClusteringProcessorConfig". This is a 0x28-byte struct.
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 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.
 
|-
 
|-
| 0x0 || 0x8 || ExposureTime
+
| 0x7 || 0x1 || || || Unused
 
|-
 
|-
| 0x8 || 0x1 || LightTarget
+
| 0x8 || 0x1 || 0x2 || Low || Mini Cycle 2 LED Intensity.
 
|-
 
|-
| 0x9 || 0x1 || Gain
+
| 0x9 || 0x1 || 0x4 || High || Fading Transition Steps to Mini Cycle 2 (see above).
 
|-
 
|-
| 0xA || 0x1 || IsNegativeImageUsed
+
| 0xA || 0x1 || 0x4 || Low || Final Step Duration Multiplier of Mini Cycle 2 (see above).
 
|-
 
|-
| 0xB || 0x5 || Padding
+
| 0xB || 0x1 || || || Unused
 
|-
 
|-
| 0x10 || 0x2 || WindowOfInterestX
+
| 0xC || 0x1 || 0x5 || High || Mini Cycle 3 LED Intensity.
 
|-
 
|-
| 0x12 || 0x2 || WindowOfInterestY
+
| 0xD || 0x1 || 0x6 || High || Fading Transition Steps to Mini Cycle 3 (see above).
 
|-
 
|-
| 0x14 || 0x2 || WindowOfInterestWidth
+
| 0xE || 0x1 || 0x6 || Low || Final Step Duration Multiplier of Mini Cycle 3 (see above).
 
|-
 
|-
| 0x16 || 0x2 || WindowOfInterestHeight
+
| 0xF || 0x1 || || || Unused
 
|-
 
|-
| 0x18 || 0x4 || Unknown (always 0xA0003)
+
| 0x10 || 0x1 || 0x5 || Low || Mini Cycle 4 LED Intensity.
 
|-
 
|-
| 0x1C || 0x4 || ObjectPixelCountMin
+
| 0x11 || 0x1 || 0x7 || High || Fading Transition Duration to Mini Cycle 4 (see above).
 
|-
 
|-
| 0x20 || 0x4 || ObjectPixelCountMax
+
| 0x12 || 0x1 || 0x7 || Low || Final Step Duration Multiplier of Mini Cycle 4 (see above).
 
|-
 
|-
| 0x24 || 0x1 || ObjectIntensityMin
+
| 0x13 || 0x1 || || || Unused
 
|-
 
|-
| 0x25 || 0x1 || IsExternalLightFilterEnabled
+
| 0x14 || 0x1 || 0x8 || High || Mini Cycle 5 LED Intensity.
 
|-
 
|-
| 0x26 || 0x2 || Padding
+
| 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.
  −
 
  −
{| 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 || Padding
+
| 0x1B || 0x1 || || || Unused
 
|-
 
|-
| 0x10 || 0x4 || Unknown (always 0xA0003)
+
| 0x1C || 0x1 || 0xB || High || Mini Cycle 7 LED Intensity.
 
|-
 
|-
| 0x14 || 0x1 || Format
+
| 0x1D || 0x1 || 0xC || High || Fading Transition Steps  to Mini Cycle 7 (see above).
 
|-
 
|-
| 0x15 || 0x3 || Padding
+
| 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 || Padding
+
| 0x22 || 0x1 || 0xD || High || Final Step Duration Multiplier of Mini Cycle 8 (see above).
|}
  −
 
  −
= PackedTeraPluginProcessorConfig =
  −
This is "nn::irsensor::PackedTeraPluginProcessorConfig". This is an u64.
  −
 
  −
= PackedPointingProcessorConfig =
  −
This is "nn::irsensor::PackedPointingProcessorConfig". This is a 0x10-byte struct.
  −
 
  −
= PackedMcuVersion =
  −
This is "nn::irsensor::PackedMcuVersion". This is an u32.
  −
 
  −
= PackedFunctionLevel =
  −
This is nn::irsensor::PackedFunctionLevel. This is an u32.
  −
 
  −
= PackedImageTransferProcessorExConfig =
  −
This is "nn::irsensor::PackedImageTransferProcessorExConfig". This is a 0x20-byte struct.
  −
 
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Offset || Size || Description
+
| 0x23 || 0x1 || || || Unused
 
|-
 
|-
| 0x0 || 0x8 || ExposureTime
+
| 0x24 || 0x1 || 0xE || High || Mini Cycle 9 LED Intensity.
 
|-
 
|-
| 0x8 || 0x1 || LightTarget
+
| 0x25 || 0x1 || 0xF || High || Fading Transition Steps to Mini Cycle 9 (see above).
 
|-
 
|-
| 0x9 || 0x1 || Gain
+
| 0x26 || 0x1 || 0xF || Low || Final Step Duration Multiplier of Mini Cycle 9 (see above).
|-
+
|-
| 0xA || 0x1 || IsNegativeImageUsed
+
| 0x27 || 0x1 || || || Unused
|-
+
|-
| 0xB || 0x5 || Padding
+
| 0x28 || 0x1 || 0xE || Low || Mini Cycle 10 LED Intensity.
|-
+
|-
| 0x10 || 0x4 || Unknown (always 0xA0003)
+
| 0x29 || 0x1 || 0x10 || High || Fading Transition Steps to Mini Cycle 10 (see above).
|-
+
|-
| 0x14 || 0x1 || OrigFormat
+
| 0x2A || 0x1 || 0x10 || Low || Final Step Duration Multiplier of Mini Cycle 10 (see above).
|-
+
|-
| 0x15 || 0x1 || TrimmingFormat
+
| 0x2B || 0x1 || || || Unused
|-
+
|-
| 0x16 || 0x2 || TrimmingStartX
+
| 0x2C || 0x1 || 0x11 || High || Mini Cycle 11 LED Intensity.
|-
+
|-
| 0x18 || 0x2 || TrimmingStartY
+
| 0x2D || 0x1 || 0x12 || High || Fading Transition Steps to Mini Cycle 11 (see above).
|-
+
|-
| 0x1A || 0x1 || IsExternalLightFilterEnabled
+
| 0x2E || 0x1 || 0x12 || Low || Final Step Duration Multiplier of Mini Cycle 11 (see above).
|-
+
|-
| 0x1B || 0x5 || Padding
+
| 0x2F || 0x1 || || || Unused
|}
+
|-
 
+
| 0x30 || 0x1 || 0x11 || Low || Mini Cycle 12 LED Intensity.
= PackedIrLedProcessorConfig =
+
|-
This is "nn::irsensor::PackedIrLedProcessorConfig". This is a 0x10-byte struct.
+
| 0x31 || 0x1 || 0x13 || High || Fading Transition Steps to Mini Cycle 12 (see above).
 
+
|-
= BusHandle =
+
| 0x32 || 0x1 || 0x13 || Low || Final Step Duration Multiplier of Mini Cycle 12 (see above).
This is "nn::hidbus::BusHandle". This is 0x8-bytes.
+
|-
 
+
| 0x33 || 0x1 || || || Unused
{| class="wikitable" border="1"
+
|-
|-
+
| 0x34 || 0x1 || 0x14 || High || Mini Cycle 13 LED Intensity.
! Offset || Size || Description
+
|-
|-
+
| 0x35 || 0x1 || 0x15 || High || Fading Transition Steps to Mini Cycle 13 (see above).
| 0x0 || 0x4 || AbstractedPadId
+
|-
|-
+
| 0x36 || 0x1 || 0x15 || Low || Final Step Duration Multiplier of Mini Cycle 13 (see above).
| 0x4 || 0x1 || InternalIndex
+
|-
|-
+
| 0x37 || 0x1 || || || Unused
| 0x5 || 0x1 || PlayerNumber
+
|-
 +
| 0x38 || 0x1 || 0x14 || Low || Mini Cycle 14 LED Intensity.
 +
|-
 +
| 0x39 || 0x1 || 0x16 || High || Fading Transition Steps to Mini Cycle 14 (see above).
 +
|-
 +
| 0x3A || 0x1 || 0x16 || Low || Final Step Duration Multiplier of Mini Cycle 14 (see above).
 +
|-
 +
| 0x3B || 0x1 || || || Unused
 +
|-
 +
| 0x3C || 0x1 || 0x17 || High || Mini Cycle 15 LED Intensity.
 +
|-
 +
| 0x3D || 0x1 || 0x18 || High || Fading Transition Steps to Mini Cycle 15 (see above).
 +
|-
 +
| 0x3E || 0x1 || 0x18 || Low || Final Step Duration Multiplier of Mini Cycle 15 (see above).
 +
|-
 +
| 0x3F || 0x1 || || || Unused
 +
|-
 +
| 0x40 || 0x1 || 0x17 || Low || Mini Cycle 16 LED Intensity.
 +
|-
 +
| 0x41 || 0x1 || 0x19 || High || Fading Transition Steps to Mini Cycle 16 (see above). (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
 +
|-
 +
| 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.)
 +
|-
 +
| 0x43 || 0x1 || || || Unused
 +
|-
 +
| 0x44 || 0x1 || 0x1A || High || Unknown (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
 +
|-
 +
| 0x45 || 0x1 || 0x1A || Low || Unknown (Unused in older Joy-Con / Pro-Con FW. Unknown for new.)
 +
|-
 +
| 0x46 || 0x1 || || || Padding
 +
|-
 +
| 0x47 || 0x1 || || || 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
 +
|-
 +
| 0x0 || 0x1B || See above.
 +
|-
 +
| 0x1B || 0xB || Cleared to zero.
 +
|-
 +
| 0x26 || 0x5 || Unused
 +
|-
 +
| 0x2B || 0x8 || Set to an input value, which is hard-coded 0.
 +
|-
 +
| 0x33 || 0x2 || Set to value 0.
 +
|-
 +
| 0x35 || 0x1 || Set to value 1.
 +
|}
 +
 
 +
= DeviceType =
 +
This is "nn::hid::system::DeviceType".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Bits
 +
!  Description
 +
|-
 +
| 0
 +
| FullKey
 +
|-
 +
| 1
 +
| DebugPad
 +
|-
 +
| 2
 +
| HandheldLeft
 +
|-
 +
| 3
 +
| HandheldRight
 +
|-
 +
| 4
 +
| JoyLeft
 +
|-
 +
| 5
 +
| JoyRight
 +
|-
 +
| 6
 +
| Palma
 +
|-
 +
| 7
 +
| LarkHvcLeft
 +
|-
 +
| 8
 +
| LarkHvcRight
 +
|-
 +
| 9
 +
| LarkNesLeft
 +
|-
 +
| 10
 +
| LarkNesRight
 +
|-
 +
| 11
 +
| HandheldLarkHvcLeft
 +
|-
 +
| 12
 +
| HandheldLarkHvcRight
 +
|-
 +
| 13
 +
| HandheldLarkNesLeft
 +
|-
 +
| 14
 +
| HandheldLarkNesRight
 +
|-
 +
| 15
 +
| Lucia
 +
|-
 +
| 16-30
 +
| Reserved
 +
|-
 +
| 31
 +
| System
 +
|}
 +
 
 +
= UniquePadType =
 +
This is "nn::hid::system::UniquePadType".
 +
 
 +
{| class="wikitable" border="1"
 +
!  Value
 +
!  Description
 +
|-
 +
| 0x0 || Other
 +
|-
 +
| 0x1 || FullKey
 +
|-
 +
| 0x2 || JoyRight
 +
|-
 +
| 0x3 || JoyLeft
 +
|-
 +
| 0x4 || DebugPad
 +
|}
 +
 
 +
= 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.
 +
 
 +
{| 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
 
| 0x6 || 0x1 || BusTypeId
Line 2,527: Line 3,282:     
= JoyPollingReceivedData =
 
= JoyPollingReceivedData =
This is "nn::hidbus::JoyPollingReceivedData". This is 0x40-bytes.
+
This is "nn::hidbus::JoyPollingReceivedData".
    
This is copied from the entries in [[#EnableJoyPollingReceiveMode|TransferMemory]] by GetJoyPollingReceivedData.
 
This is copied from the entries in [[#EnableJoyPollingReceiveMode|TransferMemory]] by GetJoyPollingReceivedData.
Line 2,543: Line 3,298:     
= BusType =
 
= BusType =
This is "nn::hidbus::BusType". This is an u32.
+
This is "nn::hidbus::BusType".
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 2,557: Line 3,312:     
= 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"
Line 2,569: Line 3,324:  
| 2 || [6.0.0+] sdknso uses <code>GetJoyButtonOnlyPollingDataAccessor</code> with this.
 
| 2 || [6.0.0+] sdknso uses <code>GetJoyButtonOnlyPollingDataAccessor</code> with this.
 
|}
 
|}
 +
 +
Other values causes [[#EnableJoyPollingReceiveMode]] to assert.
    
= ExternalDevices =
 
= ExternalDevices =

Navigation menu