le_pm_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_pm_common.h
12  *
13  * Type definitions for le_pm.
14  *
15  */
16 #ifndef LE_PM_COMMON_H_INCLUDE_GUARD
17 #define LE_PM_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 #define IFGEN_LE_PM_PROTOCOL_ID "39f21a4932ef87d302a8f31dfe5a0af7"
23 #define IFGEN_LE_PM_MSG_SIZE 47
24 /** @addtogroup le_pm
25  * @{ **/
26 
27 
28 //--------------------------------------------------------------------------------------------------
29 /**
30  * Maximum string length for a wake-up source tag (not including the null-terminator)
31  */
32 //--------------------------------------------------------------------------------------------------
33 #define LE_PM_TAG_LEN 31
34 
35 //--------------------------------------------------------------------------------------------------
36 /**
37  * Maximum string length for a wake-up source tag (including the null-terminator)
38  */
39 //--------------------------------------------------------------------------------------------------
40 #define LE_PM_TAG_LEN_BYTES 32
41 
42 //--------------------------------------------------------------------------------------------------
43 /**
44  * Option LE_PM_REF_COUNT to manage a reference counted wakeup source
45  */
46 //--------------------------------------------------------------------------------------------------
47 #define LE_PM_REF_COUNT 1
48 
49 //--------------------------------------------------------------------------------------------------
50 /**
51  * Reference to wakeup source used by StayAwake and Relax function
52  */
53 //--------------------------------------------------------------------------------------------------
54 typedef struct le_pm_WakeupSource* le_pm_WakeupSourceRef_t;
55 
56 
57 
58 //--------------------------------------------------------------------------------------------------
59 /**
60  * Get if this client bound locally.
61  */
62 //--------------------------------------------------------------------------------------------------
63 LE_SHARED bool ifgen_le_pm_HasLocalBinding
64 (
65  void
66 );
67 
68 
69 //--------------------------------------------------------------------------------------------------
70 /**
71  * Init data that is common across all threads
72  */
73 //--------------------------------------------------------------------------------------------------
74 LE_SHARED void ifgen_le_pm_InitCommonData
75 (
76  void
77 );
78 
79 
80 //--------------------------------------------------------------------------------------------------
81 /**
82  * Perform common initialization and open a session
83  */
84 //--------------------------------------------------------------------------------------------------
85 LE_SHARED le_result_t ifgen_le_pm_OpenSession
86 (
87  le_msg_SessionRef_t _ifgen_sessionRef,
88  bool isBlocking
89 );
90 
91 //--------------------------------------------------------------------------------------------------
92 /**
93  * Create a wakeup source
94  *
95  * @return
96  * - Reference to wakeup source (to be used later for acquiring/releasing)
97  *
98  * @note The process exits if an invalid or existing tag is passed
99  */
100 //--------------------------------------------------------------------------------------------------
101 LE_SHARED le_pm_WakeupSourceRef_t ifgen_le_pm_NewWakeupSource
102 (
103  le_msg_SessionRef_t _ifgen_sessionRef,
104  uint32_t createOpts,
105  ///< [IN] Wakeup source options
106  const char* LE_NONNULL wsTag
107  ///< [IN] Context-specific wakeup source tag
108 );
109 
110 //--------------------------------------------------------------------------------------------------
111 /**
112  * Acquire a wakeup source
113  *
114  * @return
115  * - LE_OK if the wakeup source is acquired
116  * - LE_NO_MEMORY if the wakeup sources limit is reached
117  * - LE_FAULT for other errors
118  *
119  * @note The process exits if an invalid reference is passed
120  * @note The wakeup sources limit is fixed by the kernel CONFIG_PM_WAKELOCKS_LIMIT configuration
121  * variable
122  */
123 //--------------------------------------------------------------------------------------------------
124 LE_SHARED le_result_t ifgen_le_pm_StayAwake
125 (
126  le_msg_SessionRef_t _ifgen_sessionRef,
128  ///< [IN] Reference to a created wakeup source
129 );
130 
131 //--------------------------------------------------------------------------------------------------
132 /**
133  * Release a previously acquired wakeup source
134  *
135  * @return
136  * - LE_OK if the wakeup source is acquired
137  * - LE_NOT_FOUND if the wakeup source was not currently acquired
138  * - LE_FAULT for other errors
139  *
140  * @note The process exits if an invalid reference is passed
141  */
142 //--------------------------------------------------------------------------------------------------
143 LE_SHARED le_result_t ifgen_le_pm_Relax
144 (
145  le_msg_SessionRef_t _ifgen_sessionRef,
147  ///< [IN] Reference to a created wakeup source
148 );
149 
150 //--------------------------------------------------------------------------------------------------
151 /**
152  * Release and destroy all acquired wakeup source, kill all clients
153  *
154  * @return
155  * - LE_OK if the wakeup source is acquired
156  * - LE_NOT_PERMITTED if the le_pm_StayAwake() has not failed with LE_NO_MEMORY
157  * - LE_FAULT for other errors
158  *
159  * @note The service is available only if le_pm_StayAwake() has returned LE_NO_MEMORY. It should be
160  * used in the way to release and destroy all wakeup sources.
161  */
162 //--------------------------------------------------------------------------------------------------
163 LE_SHARED le_result_t ifgen_le_pm_ForceRelaxAndDestroyAllWakeupSource
164 (
165  le_msg_SessionRef_t _ifgen_sessionRef
166 );
167 /** @} **/
168 #endif // LE_PM_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:287
le_result_t
Definition: le_basics.h:46
struct le_pm_WakeupSource * le_pm_WakeupSourceRef_t
Definition: le_pm_common.h:54
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860