le_framework_interface.h

Go to the documentation of this file.
1 
2 
3 /*
4  * ====================== WARNING ======================
5  *
6  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
7  * DO NOT MODIFY IN ANY WAY.
8  *
9  * ====================== WARNING ======================
10  */
11 
12 /**
13  * @page c_framework Framework Control API
14  *
15  * @ref le_framework_interface.h "API Reference"
16  *
17  * API for controlling the framework. This API should only be made available to privileged users.
18  *
19  * @section legatoServicesSupervisor_binding Binding
20  *
21  * You can use a definition @c .adef file to bind your client-side app and component to the
22  * server-side Framework Control service.
23  *
24  * This code sample shows how to bind an app to this service:
25  * @code
26  * bindings
27  * {
28  * myExe.myComp.le_framework -> <root>.le_framework
29  * }
30  * @endcode
31  *
32  * See @ref defFilesAdef for details.
33  *
34  * <HR>
35  *
36  * Copyright (C) Sierra Wireless Inc.
37  */
38 /**
39  * @file le_framework_interface.h
40  *
41  * Legato @ref c_framework include file.
42  *
43  * Copyright (C) Sierra Wireless Inc.
44  */
45 
46 #ifndef LE_FRAMEWORK_INTERFACE_H_INCLUDE_GUARD
47 #define LE_FRAMEWORK_INTERFACE_H_INCLUDE_GUARD
48 
49 
50 #include "legato.h"
51 
52 // Internal includes for this interface
53 #include "le_framework_common.h"
54 /** @addtogroup le_framework le_framework API Reference
55  * @{
56  * @file le_framework_common.h
57  * @file le_framework_interface.h **/
58 //--------------------------------------------------------------------------------------------------
59 /**
60  * Type for handler called when a server disconnects.
61  */
62 //--------------------------------------------------------------------------------------------------
63 typedef void (*le_framework_DisconnectHandler_t)(void *);
64 
65 //--------------------------------------------------------------------------------------------------
66 /**
67  *
68  * Connect the current client thread to the service providing this API. Block until the service is
69  * available.
70  *
71  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
72  * called before any other functions in this API. Normally, ConnectService is automatically called
73  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
74  *
75  * This function is created automatically.
76  */
77 //--------------------------------------------------------------------------------------------------
79 (
80  void
81 );
82 
83 //--------------------------------------------------------------------------------------------------
84 /**
85  *
86  * Try to connect the current client thread to the service providing this API. Return with an error
87  * if the service is not available.
88  *
89  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
90  * called before any other functions in this API. Normally, ConnectService is automatically called
91  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
92  *
93  * This function is created automatically.
94  *
95  * @return
96  * - LE_OK if the client connected successfully to the service.
97  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
98  * bound.
99  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
100  * - LE_COMM_ERROR if the Service Directory cannot be reached.
101  */
102 //--------------------------------------------------------------------------------------------------
104 (
105  void
106 );
107 
108 //--------------------------------------------------------------------------------------------------
109 /**
110  * Set handler called when server disconnection is detected.
111  *
112  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
113  * to continue without exiting, it should call longjmp() from inside the handler.
114  */
115 //--------------------------------------------------------------------------------------------------
117 (
118  le_framework_DisconnectHandler_t disconnectHandler,
119  void *contextPtr
120 );
121 
122 //--------------------------------------------------------------------------------------------------
123 /**
124  *
125  * Disconnect the current client thread from the service providing this API.
126  *
127  * Normally, this function doesn't need to be called. After this function is called, there's no
128  * longer a connection to the service, and the functions in this API can't be used. For details, see
129  * @ref apiFilesC_client.
130  *
131  * This function is created automatically.
132  */
133 //--------------------------------------------------------------------------------------------------
135 (
136  void
137 );
138 
139 
140 //--------------------------------------------------------------------------------------------------
141 /**
142  * Stops the Legato framework.
143  *
144  * @return
145  * LE_OK if successful.
146  * LE_DUPLICATE if the framework is in the process of shutting down (perhaps someone else has
147  * already requested the framework be stopped or restarted).
148  */
149 //--------------------------------------------------------------------------------------------------
151 (
152  void
153 );
154 
155 //--------------------------------------------------------------------------------------------------
156 /**
157  * Restarts the Legato framework.
158  *
159  * @return
160  * LE_OK if the request was accepted and the restart procedure has begun.
161  * LE_DUPLICATE if the framework is already in the process of shutting down (perhaps someone
162  * else has already requested the framework be stopped or restarted).
163  */
164 //--------------------------------------------------------------------------------------------------
166 (
167  bool manualRestart
168  ///< [IN] Was the restart manually triggered e.g. "legato restart"
169 );
170 
171 //--------------------------------------------------------------------------------------------------
172 /**
173  * Reports if the Legato framework is stopping.
174  *
175  * @return
176  * true if the framework is stopping or rebooting
177  * false otherwise
178  */
179 //--------------------------------------------------------------------------------------------------
181 (
182  void
183 );
184 
185 //--------------------------------------------------------------------------------------------------
186 /**
187  * Checks whether legato framework is Read-Only or not.
188  *
189  * @return
190  * true if the framework is Read-Only
191  * false otherwise
192  */
193 //--------------------------------------------------------------------------------------------------
195 (
196  void
197 );
198 
199 //--------------------------------------------------------------------------------------------------
200 /**
201  * Mark the next reboot as expected. Should be called by short lived app that shutdown platform
202  * after a small wakeup. This prevents system not to rollback on expected reboot.
203  */
204 //--------------------------------------------------------------------------------------------------
206 (
207  void
208 );
209 
210 /** @} **/
211 
212 #endif // LE_FRAMEWORK_INTERFACE_H_INCLUDE_GUARD
le_result_t
Definition: le_basics.h:46
bool le_framework_IsStopping(void)
void(* le_framework_DisconnectHandler_t)(void *)
Definition: le_framework_interface.h:63
void le_framework_NotifyExpectedReboot(void)
LE_FULL_API void le_framework_SetServerDisconnectHandler(le_framework_DisconnectHandler_t disconnectHandler, void *contextPtr)
le_result_t le_framework_TryConnectService(void)
void le_framework_DisconnectService(void)
#define LE_FULL_API
Definition: le_apiFeatures.h:40
void le_framework_ConnectService(void)
le_result_t le_framework_Stop(void)
le_result_t le_framework_Restart(bool manualRestart)
bool le_framework_IsReadOnly(void)