le_appInfo_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_appInfo Application Information API
14  *
15  * @ref le_appInfo_interface.h "API Reference"
16  *
17  * This API provides information about applications.
18  *
19  * All the functions in this API are provided by the @b Supervisor.
20  *
21  * Here's a code sample binding to this service:
22  * @verbatim
23  bindings:
24  {
25  clientExe.clientComponent.le_appInfo -> <root>.le_appInfo
26  }
27  @endverbatim
28  *
29  * <HR>
30  *
31  * Copyright (C) Sierra Wireless Inc.
32  */
33 /**
34  * @file le_appInfo_interface.h
35  *
36  * Legato @ref c_appInfo include file.
37  *
38  * Copyright (C) Sierra Wireless Inc.
39  */
40 
41 #ifndef LE_APPINFO_INTERFACE_H_INCLUDE_GUARD
42 #define LE_APPINFO_INTERFACE_H_INCLUDE_GUARD
43 
44 
45 #include "legato.h"
46 
47 // Interface specific includes
48 #include "le_limit_interface.h"
49 
50 
51 //--------------------------------------------------------------------------------------------------
52 /**
53  * Type for handler called when a server disconnects.
54  */
55 //--------------------------------------------------------------------------------------------------
56 typedef void (*le_appInfo_DisconnectHandler_t)(void *);
57 
58 //--------------------------------------------------------------------------------------------------
59 /**
60  *
61  * Connect the current client thread to the service providing this API. Block until the service is
62  * available.
63  *
64  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
65  * called before any other functions in this API. Normally, ConnectService is automatically called
66  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
67  *
68  * This function is created automatically.
69  */
70 //--------------------------------------------------------------------------------------------------
72 (
73  void
74 );
75 
76 //--------------------------------------------------------------------------------------------------
77 /**
78  *
79  * Try to connect the current client thread to the service providing this API. Return with an error
80  * if the service is not available.
81  *
82  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
83  * called before any other functions in this API. Normally, ConnectService is automatically called
84  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
85  *
86  * This function is created automatically.
87  *
88  * @return
89  * - LE_OK if the client connected successfully to the service.
90  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
91  * bound.
92  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
93  * - LE_COMM_ERROR if the Service Directory cannot be reached.
94  */
95 //--------------------------------------------------------------------------------------------------
97 (
98  void
99 );
100 
101 //--------------------------------------------------------------------------------------------------
102 /**
103  * Set handler called when server disconnection is detected.
104  *
105  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
106  * to continue without exiting, it should call longjmp() from inside the handler.
107  */
108 //--------------------------------------------------------------------------------------------------
110 (
111  le_appInfo_DisconnectHandler_t disconnectHandler,
112  void *contextPtr
113 );
114 
115 //--------------------------------------------------------------------------------------------------
116 /**
117  *
118  * Disconnect the current client thread from the service providing this API.
119  *
120  * Normally, this function doesn't need to be called. After this function is called, there's no
121  * longer a connection to the service, and the functions in this API can't be used. For details, see
122  * @ref apiFilesC_client.
123  *
124  * This function is created automatically.
125  */
126 //--------------------------------------------------------------------------------------------------
128 (
129  void
130 );
131 
132 
133 //--------------------------------------------------------------------------------------------------
134 /**
135  * Length of an MD5 hash string.
136  */
137 //--------------------------------------------------------------------------------------------------
138 #define LE_APPINFO_MD5_STR_LEN 32
139 
140 //--------------------------------------------------------------------------------------------------
141 /**
142  * Application states.
143  */
144 //--------------------------------------------------------------------------------------------------
145 typedef enum
146 {
148  ///< Application has been stopped or never started.
150  ///< Application is running.
151 }
153 
154 
155 //--------------------------------------------------------------------------------------------------
156 /**
157  * Process states.
158  */
159 //--------------------------------------------------------------------------------------------------
160 typedef enum
161 {
163  ///< Process has been stopped or never started.
165  ///< Process is running.
166 }
168 
169 
170 //--------------------------------------------------------------------------------------------------
171 /**
172  * Gets the state of the specified application. The state of unknown applications is STOPPED.
173  *
174  * @return
175  * The state of the specified application.
176  *
177  * @note If the application name pointer is null or if its string is empty or of bad format it is a
178  * fatal error, the function will not return.
179  */
180 //--------------------------------------------------------------------------------------------------
182 (
183  const char* LE_NONNULL appName
184  ///< [IN] Application name.
185 );
186 
187 //--------------------------------------------------------------------------------------------------
188 /**
189  * Gets the state of the specified process in an application. This function only works for
190  * configured processes that the Supervisor starts directly.
191  *
192  * @return
193  * The state of the specified process.
194  *
195  * @note If the application or process names pointers are null or if their strings are empty or of
196  * bad format it is a fatal error, the function will not return.
197  */
198 //--------------------------------------------------------------------------------------------------
200 (
201  const char* LE_NONNULL appName,
202  ///< [IN] Application name.
203  const char* LE_NONNULL procName
204  ///< [IN] Process name.
205 );
206 
207 //--------------------------------------------------------------------------------------------------
208 /**
209  * Gets the application name of the process with the specified PID.
210  *
211  * @return
212  * LE_OK if the application name was successfully found.
213  * LE_OVERFLOW if the application name could not fit in the provided buffer.
214  * LE_NOT_FOUND if the process is not part of an application.
215  * LE_FAULT if there was an error.
216  */
217 //--------------------------------------------------------------------------------------------------
219 (
220  int32_t pid,
221  ///< [IN] PID of the process.
222  char* appName,
223  ///< [OUT] Application name.
224  size_t appNameSize
225  ///< [IN]
226 );
227 
228 //--------------------------------------------------------------------------------------------------
229 /**
230  * Gets the application hash as a hexidecimal string. The application hash is a unique hash of the
231  * current version of the application.
232  *
233  * @return
234  * LE_OK if the application has was successfully retrieved.
235  * LE_OVERFLOW if the application hash could not fit in the provided buffer.
236  * LE_NOT_FOUND if the application is not installed.
237  * LE_FAULT if there was an error.
238  *
239  * @note If the application name pointer is null or if its string is empty or of bad format it is a
240  * fatal error, the function will not return.
241  */
242 //--------------------------------------------------------------------------------------------------
244 (
245  const char* LE_NONNULL appName,
246  ///< [IN] Application name.
247  char* hashStr,
248  ///< [OUT] Hash string.
249  size_t hashStrSize
250  ///< [IN]
251 );
252 
253 #endif // LE_APPINFO_INTERFACE_H_INCLUDE_GUARD
le_result_t le_appInfo_GetHash(const char *LE_NONNULL appName, char *hashStr, size_t hashStrSize)
le_appInfo_ProcState_t
Definition: le_appInfo_interface.h:160
void le_appInfo_DisconnectService(void)
Application has been stopped or never started.
Definition: le_appInfo_interface.h:147
le_result_t
Definition: le_basics.h:35
Application is running.
Definition: le_appInfo_interface.h:149
le_appInfo_State_t le_appInfo_GetState(const char *LE_NONNULL appName)
le_appInfo_State_t
Definition: le_appInfo_interface.h:145
Process is running.
Definition: le_appInfo_interface.h:164
le_appInfo_ProcState_t le_appInfo_GetProcState(const char *LE_NONNULL appName, const char *LE_NONNULL procName)
void le_appInfo_ConnectService(void)
void(* le_appInfo_DisconnectHandler_t)(void *)
Definition: le_appInfo_interface.h:56
void le_appInfo_SetServerDisconnectHandler(le_appInfo_DisconnectHandler_t disconnectHandler, void *contextPtr)
le_result_t le_appInfo_GetName(int32_t pid, char *appName, size_t appNameSize)
Process has been stopped or never started.
Definition: le_appInfo_interface.h:162
le_result_t le_appInfo_TryConnectService(void)