HID services: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1,199: | Line 1,199: | ||
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 | 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" | |||
|- | |||
! 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. | |||
=== DeviceFormat === | |||
{| 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: | |||
{| class="wikitable" border="1" | |||
! Value | |||
! Description | |||
|- | |||
| 0 || None | |||
|- | |||
| 1 || [[#MomentProcessorState]] | |||
|- | |||
| 2 || [[#ClusteringProcessorState]] | |||
|- | |||
| 3 || [[#ImageTransferProcessorState]] | |||
|- | |||
| 4 || [[#PointingProcessorState]] | |||
|- | |||
| 5 || [[#TeraPluginProcessorState]] | |||
|- | |||
| 6 || Unknown | |||
|} | |||
==== MomentProcessorState ==== | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x8 || SamplingNumber | |||
|- | |||
| 0x8 || 0x8 || TimeStamp | |||
|- | |||
| 0x10 || 0x4 || AmbientNoiseLevel | |||
|- | |||
| 0x14 || 0x4 || Reserved | |||
|- | |||
| 0x18 || 0x240 || Array of [[#MomentStatistic]] | |||
|} | |||
===== MomentStatistic ===== | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x4 || AverageIntensity | |||
|- | |||
| 0x4 || 0x4 || CentroidX | |||
|- | |||
| 0x8 || 0x4 || CentroidY | |||
|} | |||
==== ClusteringProcessorState ==== | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x8 || SamplingNumber | |||
|- | |||
| 0x8 || 0x8 || TimeStamp | |||
|- | |||
| 0x10 || 0x1 || ObjectCount | |||
|- | |||
| 0x11 || 0x3 || Reserved | |||
|- | |||
| 0x14 || 0x4 || AmbientNoiseLevel | |||
|- | |||
| 0x18 || 0x180 || Array of [[#ClusteringData]] | |||
|} | |||
===== ClusteringData ===== | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x4 || AverageIntensity | |||
|- | |||
| 0x4 || 0x4 || CentroidX | |||
|- | |||
| 0x8 || 0x4 || CentroidY | |||
|- | |||
| 0xC || 0x4 || PixelCount | |||
|- | |||
| 0x10 || 0x2 || BoundX | |||
|- | |||
| 0x12 || 0x2 || BoundY | |||
|- | |||
| 0x14 || 0x2 || BoundtWidth | |||
|- | |||
| 0x16 || 0x2 || BoundHeight | |||
|} | |||
==== PointingProcessorState ==== | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x8 || SamplingNumber | |||
|- | |||
| 0x8 || 0x8 || TimeStamp | |||
|- | |||
| 0x10 || 0x60 || Unknown | |||
|} | |||
==== TeraPluginProcessorState ==== | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x8 || SamplingNumber | |||
|- | |||
| 0x8 || 0x8 || TimeStamp | |||
|- | |||
| 0x10 || 0x130 || Unknown | |||
|} | |||
=== AruidFormat === | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x8 || IrSensorAruid | |||
|- | |||
| 0x8 || 0x8 || IrSensorAruidStatus | |||
|} | |||
== StopImageProcessor == | == StopImageProcessor == | ||
| Line 1,211: | Line 1,360: | ||
== RunImageTransferProcessor == | == RunImageTransferProcessor == | ||
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], a [[#PackedImageTransferProcessorConfig]], an u64 for the | 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. | ||
Official sw creates the TransferMemory with an user-specified buffer and permissions=0. | Official sw creates the TransferMemory with an user-specified buffer and permissions=0. | ||
| Line 1,237: | Line 1,386: | ||
== RunImageTransferExProcessor == | == RunImageTransferExProcessor == | ||
Takes a PID-descriptor, an [[#IrCameraHandle]], an [[AM_services|AppletResourceUserId]], a [[#PackedImageTransferProcessorExConfig]], an u64 for the | 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. | ||
Official sw creates the TransferMemory with an user-specified buffer and permissions=0. | Official sw creates the TransferMemory with an user-specified buffer and permissions=0. | ||