le_temp_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_temp_common.h
12  *
13  * Type definitions for le_temp.
14  *
15  */
16 #ifndef LE_TEMP_COMMON_H_INCLUDE_GUARD
17 #define LE_TEMP_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 #define IFGEN_LE_TEMP_PROTOCOL_ID "01650568439a3a9c47468069df5a7783"
23 #define IFGEN_LE_TEMP_MSG_SIZE 120
24 /** @addtogroup le_temp
25  * @{ **/
26 
27 
28 //--------------------------------------------------------------------------------------------------
29 /**
30  * Maximum sensor's name string length.
31  */
32 //--------------------------------------------------------------------------------------------------
33 #define LE_TEMP_SENSOR_NAME_MAX_LEN 100
34 
35 //--------------------------------------------------------------------------------------------------
36 /**
37  * Maximum sensor's name string length.
38  * One extra byte is added for the null character.
39  */
40 //--------------------------------------------------------------------------------------------------
41 #define LE_TEMP_SENSOR_NAME_MAX_BYTES 101
42 
43 //--------------------------------------------------------------------------------------------------
44 /**
45  * Maximum threshold's name string length.
46  */
47 //--------------------------------------------------------------------------------------------------
48 #define LE_TEMP_THRESHOLD_NAME_MAX_LEN 100
49 
50 //--------------------------------------------------------------------------------------------------
51 /**
52  * Maximum threshold's name string length.
53  * One extra byte is added for the null character.
54  */
55 //--------------------------------------------------------------------------------------------------
56 #define LE_TEMP_THRESHOLD_NAME_MAX_BYTES 101
57 
58 //--------------------------------------------------------------------------------------------------
59 /**
60  * Reference type for a temperature sensor.
61  */
62 //--------------------------------------------------------------------------------------------------
63 typedef struct le_temp_Sensor* le_temp_SensorRef_t;
64 
65 
66 //--------------------------------------------------------------------------------------------------
67 /**
68  * Reference type used by Add/Remove functions for EVENT 'le_temp_ThresholdEvent'
69  */
70 //--------------------------------------------------------------------------------------------------
71 typedef struct le_temp_ThresholdEventHandler* le_temp_ThresholdEventHandlerRef_t;
72 
73 
74 //--------------------------------------------------------------------------------------------------
75 /**
76  * Handler for Temperature event.
77  */
78 //--------------------------------------------------------------------------------------------------
80 (
81  le_temp_SensorRef_t sensor,
82  ///< Temperature sensor reference.
83  const char* LE_NONNULL threshold,
84  ///< Name of the raised threshold.
85  void* contextPtr
86  ///<
87 );
88 
89 
90 //--------------------------------------------------------------------------------------------------
91 /**
92  * Get if this client bound locally.
93  */
94 //--------------------------------------------------------------------------------------------------
95 LE_SHARED bool ifgen_le_temp_HasLocalBinding
96 (
97  void
98 );
99 
100 
101 //--------------------------------------------------------------------------------------------------
102 /**
103  * Init data that is common across all threads
104  */
105 //--------------------------------------------------------------------------------------------------
106 LE_SHARED void ifgen_le_temp_InitCommonData
107 (
108  void
109 );
110 
111 
112 //--------------------------------------------------------------------------------------------------
113 /**
114  * Perform common initialization and open a session
115  */
116 //--------------------------------------------------------------------------------------------------
117 LE_SHARED le_result_t ifgen_le_temp_OpenSession
118 (
119  le_msg_SessionRef_t _ifgen_sessionRef,
120  bool isBlocking
121 );
122 
123 //--------------------------------------------------------------------------------------------------
124 /**
125  * Request a temperature sensor reference.
126  *
127  * @return
128  * - Reference to the temperature sensor.
129  * - NULL when the requested sensor is not supported.
130  */
131 //--------------------------------------------------------------------------------------------------
132 LE_SHARED le_temp_SensorRef_t ifgen_le_temp_Request
133 (
134  le_msg_SessionRef_t _ifgen_sessionRef,
135  const char* LE_NONNULL sensorName
136  ///< [IN] Name of the temperature sensor.
137 );
138 
139 //--------------------------------------------------------------------------------------------------
140 /**
141  * Retrieve the temperature sensor's name from its reference.
142  *
143  * @return
144  * - LE_OK The function succeeded.
145  * - LE_OVERFLOW The name length exceed the maximum length.
146  * - LE_FAULT The function failed.
147  */
148 //--------------------------------------------------------------------------------------------------
149 LE_SHARED le_result_t ifgen_le_temp_GetSensorName
150 (
151  le_msg_SessionRef_t _ifgen_sessionRef,
152  le_temp_SensorRef_t sensor,
153  ///< [IN] Temperature sensor reference.
154  char* sensorName,
155  ///< [OUT] Name of the temperature sensor.
156  size_t sensorNameSize
157  ///< [IN]
158 );
159 
160 //--------------------------------------------------------------------------------------------------
161 /**
162  * Add handler function for EVENT 'le_temp_ThresholdEvent'
163  *
164  * This event provides information on the threshold reached.
165  *
166  */
167 //--------------------------------------------------------------------------------------------------
168 LE_SHARED le_temp_ThresholdEventHandlerRef_t ifgen_le_temp_AddThresholdEventHandler
169 (
170  le_msg_SessionRef_t _ifgen_sessionRef,
171  le_temp_ThresholdEventHandlerFunc_t ThresholdEventHandlerPtr,
172  ///< [IN]
173  void* contextPtr
174  ///< [IN]
175 );
176 
177 //--------------------------------------------------------------------------------------------------
178 /**
179  * Remove handler function for EVENT 'le_temp_ThresholdEvent'
180  */
181 //--------------------------------------------------------------------------------------------------
182 LE_SHARED void ifgen_le_temp_RemoveThresholdEventHandler
183 (
184  le_msg_SessionRef_t _ifgen_sessionRef,
186  ///< [IN]
187 );
188 
189 //--------------------------------------------------------------------------------------------------
190 /**
191  * Get the temperature in degree Celsius.
192  *
193  * @return
194  * - LE_OK The function succeeded.
195  * - LE_FAULT The function failed to get the temperature.
196  */
197 //--------------------------------------------------------------------------------------------------
198 LE_SHARED le_result_t ifgen_le_temp_GetTemperature
199 (
200  le_msg_SessionRef_t _ifgen_sessionRef,
201  le_temp_SensorRef_t sensor,
202  ///< [IN] Temperature sensor reference.
203  int32_t* temperaturePtr
204  ///< [OUT] Temperature in degree Celsius.
205 );
206 
207 //--------------------------------------------------------------------------------------------------
208 /**
209  * Set the temperature threshold in degree Celsius. This function does not start the temperature
210  * monitoring, call le_temp_StartMonitoring() to start it.
211  *
212  * @return
213  * - LE_OK The function succeeded.
214  * - LE_FAULT The function failed.
215  */
216 //--------------------------------------------------------------------------------------------------
217 LE_SHARED le_result_t ifgen_le_temp_SetThreshold
218 (
219  le_msg_SessionRef_t _ifgen_sessionRef,
220  le_temp_SensorRef_t sensor,
221  ///< [IN] Temperature sensor reference.
222  const char* LE_NONNULL threshold,
223  ///< [IN] Name of the threshold.
224  int32_t temperature
225  ///< [IN] Temperature threshold in degree Celsius.
226 );
227 
228 //--------------------------------------------------------------------------------------------------
229 /**
230  * Get the temperature threshold in degree Celsius.
231  *
232  * @return
233  * - LE_OK The function succeeded.
234  * - LE_FAULT The function failed.
235  */
236 //--------------------------------------------------------------------------------------------------
237 LE_SHARED le_result_t ifgen_le_temp_GetThreshold
238 (
239  le_msg_SessionRef_t _ifgen_sessionRef,
240  le_temp_SensorRef_t sensor,
241  ///< [IN] Temperature sensor reference.
242  const char* LE_NONNULL threshold,
243  ///< [IN] Name of the threshold.
244  int32_t* temperaturePtr
245  ///< [OUT] Temperature threshold in degree Celsius.
246 );
247 
248 //--------------------------------------------------------------------------------------------------
249 /**
250  * Start the temperature monitoring with the temperature thresholds configured by
251  * le_temp_SetThreshold() function.
252  *
253  * @return
254  * - LE_OK The function succeeded.
255  * - LE_BAD_PARAMETER There is a mismatch with the configured threshold values.
256  * - LE_FAULT The function failed to apply the thresholds.
257  */
258 //--------------------------------------------------------------------------------------------------
259 LE_SHARED le_result_t ifgen_le_temp_StartMonitoring
260 (
261  le_msg_SessionRef_t _ifgen_sessionRef
262 );
263 /** @} **/
264 #endif // LE_TEMP_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:300
le_result_t
Definition: le_basics.h:46
struct le_temp_ThresholdEventHandler * le_temp_ThresholdEventHandlerRef_t
Definition: le_temp_common.h:71
void(* le_temp_ThresholdEventHandlerFunc_t)(le_temp_SensorRef_t sensor, const char *LE_NONNULL threshold, void *contextPtr)
Definition: le_temp_common.h:80
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
struct le_temp_Sensor * le_temp_SensorRef_t
Definition: le_temp_common.h:63