# fuchsia.lightsensor

<br />

Added: 7

## **PROTOCOLS**

## Calibrator

*Defined in [fuchsia.lightsensor/calibrator.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/calibrator.fidl;l=10)*

`Calibrator` is responsible for calibrating the raw data that comes from the
product-configured light sensor. It is only intended to be used internally.
Removed: HEAD Deprecated: 9 Added: 7

<br />

### Calibrate

Calibrates the supplied raw \[Rgbc\] and returns calibrated \[Rgbc\].

#### Request

| Name | Type |
|---|---|
| `data` | `https://fuchsia.dev/reference/fidl/fuchsia.lightsensor#Rgbc` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.lightsensor#Calibrator_Calibrate_Result` |

## Sensor

*Defined in [fuchsia.lightsensor/sensor.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/sensor.fidl;l=9)*

`Sensor` will return calibrated readings from a product-configured light
sensor.

<br />

### Watch

Gets the current \[LightSensorData\]. Returns immediately on first call;
subsequent calls return when the value changes.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `data` | `https://fuchsia.dev/reference/fidl/fuchsia.lightsensor#LightSensorData` |

## **STRUCTS**

### Calibrator_Calibrate_Response

*Defined in [fuchsia.lightsensor/calibrator.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/calibrator.fidl;l=14)*

| Field | Type | Description | Default |
|---|---|---|---|
| `data` | `https://fuchsia.dev/reference/fidl/fuchsia.lightsensor#Rgbc` |   | No default |

### Rgbc

*Defined in [fuchsia.lightsensor/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/types.fidl;l=7)*

Device-specific intensity values for the color channels in the light sensor.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `red_intensity` | `float32` | Intensity of red light measured by the light sensor. | No default |
| `green_intensity` | `float32` | Intensity of green light measured by the light sensor. | No default |
| `blue_intensity` | `float32` | Intensity of blue light measured by the light sensor. | No default |
| `clear_intensity` | `float32` | Intensity of clear light measured by the light sensor. | No default |

## **ENUMS**

### Error [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.lightsensor/types.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/types.fidl;l=23)*

Possible error results from API calls.
Removed: HEAD Deprecated: 9 Added: 7

<br />

| Name | Value | Description |
|---|---|---|
| ### INVALID_INPUT | `1` | The input provided to the API was outside of the valid range of input, or required parameters were missing from a table. |

## **TABLES**

### LightSensorData

*Defined in [fuchsia.lightsensor/sensor.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/sensor.fidl;l=17)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `rgbc` | `https://fuchsia.dev/reference/fidl/fuchsia.lightsensor#Rgbc` | Light intensities measured by the light sensor in raw sensor counts. The value will vary depending on the specific hardware used. This field will always be populated. |
| ### 2 | `calculated_lux` | `float32` | A weighted sum of the RGBC intensities. This field will always be populated. |
| ### 3 | `correlated_color_temperature` | `float32` | The color temperature of the measured light. This field will always be populated. |
| ### 4 | `si_rgbc` | `https://fuchsia.dev/reference/fidl/fuchsia.lightsensor#Rgbc` | Light intensities measured by the light sensor in the International System (SI) units of uW/cm\^2. This field will always be populated. Added: 11 |
| ### 5 | `is_calibrated` | `bool` | Whether or not the si_rgbc, calculated_lux and correlated_color_temperature values are calibrated. This field will always be populated. Added: 11 |

## **UNIONS**

### Calibrator_Calibrate_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.lightsensor/calibrator.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.lightsensor/calibrator.fidl;l=14)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.lightsensor#Calibrator_Calibrate_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.lightsensor#Error` |   |

<br />