le_sup_ctrl_interface.h

Go to the documentation of this file.
1 /*
2  * ====================== WARNING ======================
3  *
4  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
5  * DO NOT MODIFY IN ANY WAY.
6  *
7  * ====================== WARNING ======================
8  */
9 
10 /**
11  * @page c_sup_ctrl Supervisor Control API
12  *
13  * @ref le_sup_ctrl_interface.h "API Reference"
14  *
15  * Supervisor API for controlling the framework and applications. This API is only available to
16  * privileged users.
17  *
18  * @section legatoServicesSupervisor_binding Binding
19  *
20  * You can use a definition @c .adef file to bind your client-side app and component to the
21  * server-side Supervisor Control service.
22  *
23  * This code sample shows how to bind an app to this service:
24  * @code
25  * bindings
26  * {
27  * myExe.myComp.le_sup_ctrl -> <root>.le_sup_ctrl
28  * }
29  * @endcode
30  *
31  * See @ref defFilesAdef for details.
32  *
33  * @section legatoServicesSupervisor_start Start App
34  *
35  * Use le_sup_ctrl_StartApp() (const char * appName) to automatically start an app.
36  *
37  * The code sample shows how to use the Supervisor Control service to start an app:
38  *
39  * @code
40  * le_result_t result = le_sup_ctrl_StartApp("myApp");
41  * @endcode
42  *
43  * where @c myApp is the name of the app.
44  *
45  * @section legatoServicesSupervisor_stop Stop App
46  *
47  * Use le_sup_ctrl_StopApp() to automatically stop an app.
48  *
49  * This code sample shows how to use the Supervisor Control service to stop an app, where
50  * appAplication.app is your app's actual name:
51  *
52  * @code
53  * le_result_t result = le_sup_ctrl_StopApp("myApp");
54  * @endcode
55  *
56  * where @c myApp is the name of the app.
57  *
58  * <HR>
59  *
60  * Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
61  */
62 /**
63  * @file le_sup_ctrl_interface.h
64  *
65  * Legato @ref c_sup_ctrl include file.
66  *
67  * Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
68  */
69 
70 #ifndef LE_SUP_CTRL_INTERFACE_H_INCLUDE_GUARD
71 #define LE_SUP_CTRL_INTERFACE_H_INCLUDE_GUARD
72 
73 
74 #include "legato.h"
75 
76 // Interface specific includes
77 #include "le_limit_interface.h"
78 
79 
80 //--------------------------------------------------------------------------------------------------
81 /**
82  *
83  * Connect the current client thread to the service providing this API. Block until the service is
84  * available.
85  *
86  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
87  * called before any other functions in this API. Normally, ConnectService is automatically called
88  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
89  *
90  * This function is created automatically.
91  */
92 //--------------------------------------------------------------------------------------------------
94 (
95  void
96 );
97 
98 //--------------------------------------------------------------------------------------------------
99 /**
100  *
101  * Try to connect the current client thread to the service providing this API. Return with an error
102  * if the service is not available.
103  *
104  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
105  * called before any other functions in this API. Normally, ConnectService is automatically called
106  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
107  *
108  * This function is created automatically.
109  *
110  * @return
111  * - LE_OK if the client connected successfully to the service.
112  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
113  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
114  * - LE_COMM_ERROR if the Service Directory cannot be reached.
115  */
116 //--------------------------------------------------------------------------------------------------
118 (
119  void
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  * Starts an app.
142  *
143  * @return
144  * LE_OK if the app is successfully started.
145  * LE_DUPLICATE if the app is already running.
146  * LE_NOT_FOUND if the app isn't installed.
147  * LE_FAULT if there was an error and the app could not be launched.
148  */
149 //--------------------------------------------------------------------------------------------------
151 (
152  const char* appName
153  ///< [IN] Name of the app to start.
154 );
155 
156 //--------------------------------------------------------------------------------------------------
157 /**
158  * Stops an app.
159  *
160  * @return
161  * LE_OK if successful.
162  * LE_NOT_FOUND if the app could not be found.
163  */
164 //--------------------------------------------------------------------------------------------------
166 (
167  const char* appName
168  ///< [IN] Name of the app to stop.
169 );
170 
171 //--------------------------------------------------------------------------------------------------
172 /**
173  * Stops the Legato framework.
174  *
175  * @return
176  * LE_OK if successful.
177  * LE_DUPLICATE if the framework is in the process of shutting down (perhaps someone else has
178  * already requested the framework be stopped or restarted).
179  */
180 //--------------------------------------------------------------------------------------------------
182 (
183  void
184 );
185 
186 //--------------------------------------------------------------------------------------------------
187 /**
188  * Restarts the Legato framework.
189  *
190  * @return
191  * LE_OK if the request was accepted and the restart procedure has begun.
192  * LE_DUPLICATE if the framework is already in the process of shutting down (perhaps someone
193  * else has already requested the framework be stopped or restarted).
194  */
195 //--------------------------------------------------------------------------------------------------
197 (
198  bool manualRestart
199  ///< [IN] Was the restart manually triggered e.g. "legato restart"
200 );
201 
202 
203 #endif // LE_SUP_CTRL_INTERFACE_H_INCLUDE_GUARD
204 
le_result_t
Definition: le_basics.h:35
le_result_t le_sup_ctrl_StartApp(const char *appName)
void le_sup_ctrl_DisconnectService(void)
le_result_t le_sup_ctrl_StopLegato(void)
le_result_t le_sup_ctrl_RestartLegato(bool manualRestart)
void le_sup_ctrl_ConnectService(void)
le_result_t le_sup_ctrl_StopApp(const char *appName)
le_result_t le_sup_ctrl_TryConnectService(void)