blob: 12076e97207b3dfe996ac349877ff25bbb8e234b [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.lightsensor
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **PROTOCOLS**
## Calibrator {#Calibrator}
*Defined in [fuchsia.lightsensor/calibrator.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/calibrator.fidl;l=9)*
<p><code>Calibrator</code> is responsible for calibrating the raw data that comes from the
product-configured light sensor. It is only intended to be used internally.</p>
### Calibrate {#Calibrator.Calibrate}
<p>Calibrates the supplied raw [Rgbc] and returns calibrated [Rgbc].</p>
#### Request {#Calibrator.Calibrate_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>data</code></td>
<td>
<code><a class='link' href='#Rgbc'>Rgbc</a></code>
</td>
</tr>
</table>
#### Response {#Calibrator.Calibrate_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Calibrator_Calibrate_Result'>Calibrator_Calibrate_Result</a></code>
</td>
</tr>
</table>
## Sensor {#Sensor}
*Defined in [fuchsia.lightsensor/sensor.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/sensor.fidl;l=9)*
<p><code>Sensor</code> will return calibrated readings from a product-configured light
sensor.</p>
### Watch {#Sensor.Watch}
<p>Gets the current [LightSensorData]. Returns immediately on first call;
subsequent calls return when the value changes.</p>
#### Request {#Sensor.Watch_Request}
&lt;EMPTY&gt;
#### Response {#Sensor.Watch_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>data</code></td>
<td>
<code><a class='link' href='#LightSensorData'>LightSensorData</a></code>
</td>
</tr>
</table>
## **STRUCTS**
### Calibrator_Calibrate_Response {#Calibrator_Calibrate_Response data-text="Calibrator_Calibrate_Response"}
*Defined in [fuchsia.lightsensor/calibrator.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/calibrator.fidl;l=13)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Calibrator_Calibrate_Response.data">
<td><code>data</code></td>
<td>
<code><a class='link' href='#Rgbc'>Rgbc</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### Rgbc {#Rgbc data-text="Rgbc"}
*Defined in [fuchsia.lightsensor/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/types.fidl;l=7)*
<p>The color intensities that can be returned from a light sensor.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Rgbc.red_intensity">
<td><code>red_intensity</code></td>
<td>
<code>float32</code>
</td>
<td><p>Intensity of red light measured by the light sensor.</p>
</td>
<td>No default</td>
</tr>
<tr id="Rgbc.green_intensity">
<td><code>green_intensity</code></td>
<td>
<code>float32</code>
</td>
<td><p>Intensity of green light measured by the light sensor.</p>
</td>
<td>No default</td>
</tr>
<tr id="Rgbc.blue_intensity">
<td><code>blue_intensity</code></td>
<td>
<code>float32</code>
</td>
<td><p>Intensity of blue light measured by the light sensor.</p>
</td>
<td>No default</td>
</tr>
<tr id="Rgbc.clear_intensity">
<td><code>clear_intensity</code></td>
<td>
<code>float32</code>
</td>
<td><p>Intensity of clear light measured by the light sensor.</p>
</td>
<td>No default</td>
</tr>
</table>
## **ENUMS**
### Error [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Error data-text="Error"}
Type: <code>uint32</code>
*Defined in [fuchsia.lightsensor/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/types.fidl;l=22)*
<p>Possible error results from API calls.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="Error.INVALID_INPUT">
<td><h3 id="Error.INVALID_INPUT" class="add-link hide-from-toc">INVALID_INPUT</h3></td>
<td><code>1</code></td>
<td><p>The input provided to the API was outside of the valid range of input, or required
parameters were missing from a table.</p>
</td>
</tr>
</table>
## **TABLES**
### LightSensorData {#LightSensorData data-text="LightSensorData"}
*Defined in [fuchsia.lightsensor/sensor.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/sensor.fidl;l=17)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="LightSensorData.rgbc">
<td><h3 id="LightSensorData.rgbc" class="add-link hide-from-toc">1</h3></td>
<td><code>rgbc</code></td>
<td>
<code><a class='link' href='#Rgbc'>Rgbc</a></code>
</td>
<td><p>Light intensities measured by the light sensor.</p>
</td>
</tr>
<tr id="LightSensorData.calculated_lux">
<td><h3 id="LightSensorData.calculated_lux" class="add-link hide-from-toc">2</h3></td>
<td><code>calculated_lux</code></td>
<td>
<code>float32</code>
</td>
<td><p>A weighted sum of the RGBC intensities.</p>
</td>
</tr>
<tr id="LightSensorData.correlated_color_temperature">
<td><h3 id="LightSensorData.correlated_color_temperature" class="add-link hide-from-toc">3</h3></td>
<td><code>correlated_color_temperature</code></td>
<td>
<code>float32</code>
</td>
<td><p>The color temperature of the measured light.</p>
</td>
</tr>
</table>
## **UNIONS**
### Calibrator_Calibrate_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Calibrator_Calibrate_Result data-text="Calibrator_Calibrate_Result"}
*Defined in [fuchsia.lightsensor/calibrator.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/calibrator.fidl;l=13)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Calibrator_Calibrate_Result.response">
<td><h3 id="Calibrator_Calibrate_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Calibrator_Calibrate_Response'>Calibrator_Calibrate_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Calibrator_Calibrate_Result.err">
<td><h3 id="Calibrator_Calibrate_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='#Error'>Error</a></code>
</td>
<td></td>
</tr>
</table>