Go to the source code of this file.
◆ on_light_event_cb
typedef void(* on_light_event_cb) (UASLightEvent *event, void *context) |
Callback type used by applications to subscribe to ambient light sensor events.
Definition at line 41 of file light.h.
◆ UASensorsLight
Opaque type that models the ambient light sensor.
Definition at line 35 of file light.h.
◆ ua_sensors_light_disable()
Disables the supplied ambient light sensor.
- Returns
- U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
- Parameters
-
[in] | sensor | The sensor instance to be disabled. |
◆ ua_sensors_light_enable()
Enables the supplied ambient light sensor.
- Returns
- U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
- Parameters
-
[in] | sensor | The sensor instance to be enabled. |
◆ ua_sensors_light_get_max_value()
Queries the maximum value that can be reported by the sensor.
- Returns
- The maximum value that can be reported by the sensor.
- Parameters
-
[in] | sensor | The sensor instance to be queried. |
◆ ua_sensors_light_get_min_delay()
Queries the minimum delay between two readings for the supplied sensor.
- Returns
- The minimum delay between two readings in [ms].
- Parameters
-
[in] | sensor | The sensor instance to be queried. |
◆ ua_sensors_light_get_min_value()
Queries the minimum value that can be reported by the sensor.
- Returns
- The minimum value that can be reported by the sensor.
- Parameters
-
[in] | sensor | The sensor instance to be queried. |
◆ ua_sensors_light_get_resolution()
Queries the numeric resolution supported by the sensor.
- Returns
- The numeric resolution supported by the sensor.
- Parameters
-
[in] | sensor | The sensor instance to be queried. |
◆ ua_sensors_light_new()
Create a new object for accessing the ambient light sensor.
- Returns
- A new instance or NULL in case of errors.
◆ ua_sensors_light_set_event_rate()
Set the sensor event delivery rate in nanoseconds..
- Returns
- U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
- Parameters
-
[in] | sensor | The sensor instance to be modified. |
[in] | rate | The new event delivery rate. |
◆ ua_sensors_light_set_reading_cb()
Set the callback to be invoked whenever a new sensor reading is available.
- Parameters
-
[in] | sensor | The sensor instance to associate the callback with. |
[in] | cb | The callback to be invoked. |
[in] | ctx | The context supplied to the callback invocation. |