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 //--------------------------------------------------------------------------------------------------
55 /**
56  * Type for handler called when a server disconnects.
57  */
58 //--------------------------------------------------------------------------------------------------
59 typedef void (*le_framework_DisconnectHandler_t)(void *);
60 
61 //--------------------------------------------------------------------------------------------------
62 /**
63  *
64  * Connect the current client thread to the service providing this API. Block until the service is
65  * available.
66  *
67  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
68  * called before any other functions in this API. Normally, ConnectService is automatically called
69  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
70  *
71  * This function is created automatically.
72  */
73 //--------------------------------------------------------------------------------------------------
75 (
76  void
77 );
78 
79 //--------------------------------------------------------------------------------------------------
80 /**
81  *
82  * Try to connect the current client thread to the service providing this API. Return with an error
83  * if the service is not available.
84  *
85  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
86  * called before any other functions in this API. Normally, ConnectService is automatically called
87  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
88  *
89  * This function is created automatically.
90  *
91  * @return
92  * - LE_OK if the client connected successfully to the service.
93  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
94  * bound.
95  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
96  * - LE_COMM_ERROR if the Service Directory cannot be reached.
97  */
98 //--------------------------------------------------------------------------------------------------
100 (
101  void
102 );
103 
104 //--------------------------------------------------------------------------------------------------
105 /**
106  * Set handler called when server disconnection is detected.
107  *
108  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
109  * to continue without exiting, it should call longjmp() from inside the handler.
110  */
111 //--------------------------------------------------------------------------------------------------
113 (
114  le_framework_DisconnectHandler_t disconnectHandler,
115  void *contextPtr
116 );
117 
118 //--------------------------------------------------------------------------------------------------
119 /**
120  *
121  * Disconnect the current client thread from the service providing this API.
122  *
123  * Normally, this function doesn't need to be called. After this function is called, there's no
124  * longer a connection to the service, and the functions in this API can't be used. For details, see
125  * @ref apiFilesC_client.
126  *
127  * This function is created automatically.
128  */
129 //--------------------------------------------------------------------------------------------------
131 (
132  void
133 );
134 
135 
136 //--------------------------------------------------------------------------------------------------
137 /**
138  * Stops the Legato framework.
139  *
140  * @return
141  * LE_OK if successful.
142  * LE_DUPLICATE if the framework is in the process of shutting down (perhaps someone else has
143  * already requested the framework be stopped or restarted).
144  */
145 //--------------------------------------------------------------------------------------------------
147 (
148  void
149 );
150 
151 //--------------------------------------------------------------------------------------------------
152 /**
153  * Restarts the Legato framework.
154  *
155  * @return
156  * LE_OK if the request was accepted and the restart procedure has begun.
157  * LE_DUPLICATE if the framework is already in the process of shutting down (perhaps someone
158  * else has already requested the framework be stopped or restarted).
159  */
160 //--------------------------------------------------------------------------------------------------
162 (
163  bool manualRestart
164  ///< [IN] Was the restart manually triggered e.g. "legato restart"
165 );
166 
167 //--------------------------------------------------------------------------------------------------
168 /**
169  * Reports if the Legato framework is stopping.
170  *
171  * @return
172  * true if the framework is stopping or rebooting
173  * false otherwise
174  */
175 //--------------------------------------------------------------------------------------------------
177 (
178  void
179 );
180 
181 //--------------------------------------------------------------------------------------------------
182 /**
183  * Checks whether legato framework is Read-Only or not.
184  *
185  * @return
186  * true if the framework is Read-Only
187  * false otherwise
188  */
189 //--------------------------------------------------------------------------------------------------
191 (
192  void
193 );
194 
195 //--------------------------------------------------------------------------------------------------
196 /**
197  * Mark the next reboot as expected. Should be called by short lived app that shutdown platform
198  * after a small wakeup. This prevents system not to rollback on expected reboot.
199  */
200 //--------------------------------------------------------------------------------------------------
202 (
203  void
204 );
205 
206 #endif // LE_FRAMEWORK_INTERFACE_H_INCLUDE_GUARD
le_result_t
Definition: le_basics.h:45
void le_framework_DisconnectService(void)
le_result_t le_framework_Restart(bool manualRestart)
void le_framework_NotifyExpectedReboot(void)
le_result_t le_framework_TryConnectService(void)
le_result_t le_framework_Stop(void)
#define LE_FULL_API
Definition: le_apiFeatures.h:40
bool le_framework_IsStopping(void)
bool le_framework_IsReadOnly(void)
void le_framework_ConnectService(void)
LE_FULL_API void le_framework_SetServerDisconnectHandler(le_framework_DisconnectHandler_t disconnectHandler, void *contextPtr)
void(* le_framework_DisconnectHandler_t)(void *)
Definition: le_framework_interface.h:59