| // Copyright 2021 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.lightsensor; |
| |
| /// `Sensor` will return calibrated readings from a product-configured light |
| /// sensor. |
| @discoverable |
| protocol Sensor { |
| /// Gets the current [LightSensorData]. Returns immediately on first call; |
| /// subsequent calls return when the value changes. |
| Watch() -> (struct { |
| data LightSensorData; |
| }); |
| }; |
| |
| type LightSensorData = table { |
| /// 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. |
| 1: rgbc Rgbc; |
| |
| /// A weighted sum of the RGBC intensities. This field will always be |
| /// populated. |
| 2: calculated_lux float32; |
| |
| /// The color temperature of the measured light. This field will always be |
| /// populated. |
| 3: correlated_color_temperature float32; |
| |
| /// Light intensities measured by the light sensor in the International |
| /// System (SI) units of uW/cm^2. This field will always be populated. |
| @available(added=11) |
| 4: si_rgbc Rgbc; |
| |
| /// Whether or not the si_rgbc, calculated_lux and |
| /// correlated_color_temperature values are calibrated. This field will |
| /// always be populated. |
| @available(added=11) |
| 5: is_calibrated bool; |
| }; |