Ubuntu Platform API  3.0.0
A library helping with tight integration into the Ubuntu platform
temperature.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2020 UBports Foundation
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Florian Leeber <florian@ubports.com>
17  */
18 
19 #ifndef UBUNTU_APPLICATION_SENSORS_TEMPERATURE_H_
20 #define UBUNTU_APPLICATION_SENSORS_TEMPERATURE_H_
21 
22 #include <ubuntu/status.h>
23 #include <ubuntu/visibility.h>
24 
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35  typedef void UASensorsTemperature;
36 
42  void* context);
43 
51 
60  UASensorsTemperature* sensor);
61 
70  UASensorsTemperature* sensor);
71 
78  UBUNTU_DLL_PUBLIC uint32_t
80  UASensorsTemperature* sensor);
81 
90  UASensorsTemperature* sensor,
91  float* value);
92 
101  UASensorsTemperature* sensor,
102  float* value);
103 
112  UASensorsTemperature* sensor,
113  float* value);
114 
122  UBUNTU_DLL_PUBLIC void
124  UASensorsTemperature* sensor,
126  void *ctx);
127 
137  UASensorsTemperature* sensor,
138  uint32_t rate);
139 
140 #ifdef __cplusplus
141 }
142 #endif
143 
144 #endif /* UBUNTU_APPLICATION_SENSORS_TEMPERATURE_H_ */
visibility.h
ua_sensors_temperature_new
UBUNTU_DLL_PUBLIC UASensorsTemperature * ua_sensors_temperature_new()
Create a new object for accessing the ambient light sensor.
ua_sensors_temperature_get_max_value
UBUNTU_DLL_PUBLIC UStatus ua_sensors_temperature_get_max_value(UASensorsTemperature *sensor, float *value)
Queries the maximum value that can be reported by the sensor.
UbuntuStatus
UbuntuStatus
Indicates the status of an operation.
Definition: status.h:26
ua_sensors_temperature_get_resolution
UBUNTU_DLL_PUBLIC UStatus ua_sensors_temperature_get_resolution(UASensorsTemperature *sensor, float *value)
Queries the numeric resolution supported by the sensor.
UASTemperatureEvent
void UASTemperatureEvent
Opaque type describing an ambient light sensor reading.
Definition: temperature.h:34
UBUNTU_DLL_PUBLIC
#define UBUNTU_DLL_PUBLIC
Definition: visibility.h:26
ua_sensors_temperature_set_reading_cb
UBUNTU_DLL_PUBLIC void ua_sensors_temperature_set_reading_cb(UASensorsTemperature *sensor, on_temperature_event_cb cb, void *ctx)
Set the callback to be invoked whenever a new sensor reading is available.
UASensorsTemperature
void UASensorsTemperature
Opaque type that models the ambient light sensor.
Definition: temperature.h:35
temperature.h
ua_sensors_temperature_enable
UBUNTU_DLL_PUBLIC UStatus ua_sensors_temperature_enable(UASensorsTemperature *sensor)
Enables the supplied ambient light sensor.
ua_sensors_temperature_get_min_value
UBUNTU_DLL_PUBLIC UStatus ua_sensors_temperature_get_min_value(UASensorsTemperature *sensor, float *value)
Queries the minimum value that can be reported by the sensor.
on_temperature_event_cb
void(* on_temperature_event_cb)(UASTemperatureEvent *event, void *context)
Callback type used by applications to subscribe to ambient light sensor events.
Definition: temperature.h:41
ua_sensors_temperature_disable
UBUNTU_DLL_PUBLIC UStatus ua_sensors_temperature_disable(UASensorsTemperature *sensor)
Disables the supplied ambient light sensor.
ua_sensors_temperature_set_event_rate
UBUNTU_DLL_PUBLIC UStatus ua_sensors_temperature_set_event_rate(UASensorsTemperature *sensor, uint32_t rate)
Set the sensor event delivery rate in nanoseconds..
ua_sensors_temperature_get_min_delay
UBUNTU_DLL_PUBLIC uint32_t ua_sensors_temperature_get_min_delay(UASensorsTemperature *sensor)
Queries the minimum delay between two readings for the supplied sensor.
status.h