le_updateCtrl_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_updateCtrl_common.h
12  *
13  * Type definitions for le_updateCtrl.
14  *
15  */
16 #ifndef LE_UPDATECTRL_COMMON_H_INCLUDE_GUARD
17 #define LE_UPDATECTRL_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 #define IFGEN_LE_UPDATECTRL_PROTOCOL_ID "2068715d5da737c096cc7146ce5f1df6"
23 #define IFGEN_LE_UPDATECTRL_MSG_SIZE 12
24 /** @addtogroup le_updateCtrl
25  * @{ **/
26 
27 
28 //--------------------------------------------------------------------------------------------------
29 /**
30  * State of the system.
31  */
32 //--------------------------------------------------------------------------------------------------
33 typedef enum
34 {
36  ///< "good"
38  ///< "bad"
40  ///< "tried N" or untried.
41 }
43 
44 
45 
46 //--------------------------------------------------------------------------------------------------
47 /**
48  * Get if this client bound locally.
49  */
50 //--------------------------------------------------------------------------------------------------
51 LE_SHARED bool ifgen_le_updateCtrl_HasLocalBinding
52 (
53  void
54 );
55 
56 
57 //--------------------------------------------------------------------------------------------------
58 /**
59  * Init data that is common across all threads
60  */
61 //--------------------------------------------------------------------------------------------------
62 LE_SHARED void ifgen_le_updateCtrl_InitCommonData
63 (
64  void
65 );
66 
67 
68 //--------------------------------------------------------------------------------------------------
69 /**
70  * Perform common initialization and open a session
71  */
72 //--------------------------------------------------------------------------------------------------
73 LE_SHARED le_result_t ifgen_le_updateCtrl_OpenSession
74 (
75  le_msg_SessionRef_t _ifgen_sessionRef,
76  bool isBlocking
77 );
78 
79 //--------------------------------------------------------------------------------------------------
80 /**
81  * Prevent all updates (and roll-backs) until further notice.
82  */
83 //--------------------------------------------------------------------------------------------------
84 LE_SHARED void ifgen_le_updateCtrl_Defer
85 (
86  le_msg_SessionRef_t _ifgen_sessionRef
87 );
88 
89 //--------------------------------------------------------------------------------------------------
90 /**
91  * Allow updates to go ahead.
92  */
93 //--------------------------------------------------------------------------------------------------
94 LE_SHARED void ifgen_le_updateCtrl_Allow
95 (
96  le_msg_SessionRef_t _ifgen_sessionRef
97 );
98 
99 //--------------------------------------------------------------------------------------------------
100 /**
101  * Prevent the probation period from ending.
102  *
103  * @return false if lock failed (for example if not in a probation period).
104  */
105 //--------------------------------------------------------------------------------------------------
106 LE_SHARED bool ifgen_le_updateCtrl_LockProbation
107 (
108  le_msg_SessionRef_t _ifgen_sessionRef
109 );
110 
111 //--------------------------------------------------------------------------------------------------
112 /**
113  * Cancels a call to LockProbation(), allow the probation period to end.
114  *
115  * @note Must match previous successful call to LockProbation().
116  */
117 //--------------------------------------------------------------------------------------------------
118 LE_SHARED void ifgen_le_updateCtrl_UnlockProbation
119 (
120  le_msg_SessionRef_t _ifgen_sessionRef
121 );
122 
123 //--------------------------------------------------------------------------------------------------
124 /**
125  * Marks the system "good", ending the probation period.
126  *
127  * @return
128  * - LE_OK The system was marked Good
129  * - LE_BUSY Someone holds a probation lock
130  * - LE_DUPLICATE Probation has expired - the system has already been marked
131  */
132 //--------------------------------------------------------------------------------------------------
133 LE_SHARED le_result_t ifgen_le_updateCtrl_MarkGood
134 (
135  le_msg_SessionRef_t _ifgen_sessionRef,
136  bool force
137  ///< [IN] True to set system Good even if someone holds a probation lock
138 );
139 
140 //--------------------------------------------------------------------------------------------------
141 /**
142  * Marks the system "bad" and triggers a roll-back to a "good" system.
143  *
144  * @note Ignored if the probation period has already ended. Also, the roll-back may be delayed if
145  * someone is deferring updates using le_updateCtrl_Defer().
146  */
147 //--------------------------------------------------------------------------------------------------
148 LE_SHARED void ifgen_le_updateCtrl_FailProbation
149 (
150  le_msg_SessionRef_t _ifgen_sessionRef
151 );
152 
153 //--------------------------------------------------------------------------------------------------
154 /**
155  * Get the current system state.
156  *
157  * @note Can only be called if updates have been deferred or if a probation lock is held.
158  * Otherwise the system state could change between the time this function is called and when
159  * the return value is checked.
160  */
161 //--------------------------------------------------------------------------------------------------
162 LE_SHARED le_updateCtrl_SystemState_t ifgen_le_updateCtrl_GetSystemState
163 (
164  le_msg_SessionRef_t _ifgen_sessionRef
165 );
166 /** @} **/
167 #endif // LE_UPDATECTRL_COMMON_H_INCLUDE_GUARD
"bad"
Definition: le_updateCtrl_common.h:37
#define LE_SHARED
Definition: le_basics.h:300
le_result_t
Definition: le_basics.h:46
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
"tried N" or untried.
Definition: le_updateCtrl_common.h:39
"good"
Definition: le_updateCtrl_common.h:35
le_updateCtrl_SystemState_t
Definition: le_updateCtrl_common.h:33