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* appName
184  ///< [IN] Application name.
185 )
186 __attribute__(( nonnull(1) ));
187 
188 //--------------------------------------------------------------------------------------------------
189 /**
190  * Gets the state of the specified process in an application. This function only works for
191  * configured processes that the Supervisor starts directly.
192  *
193  * @return
194  * The state of the specified process.
195  *
196  * @note If the application or process names pointers are null or if their strings are empty or of
197  * bad format it is a fatal error, the function will not return.
198  */
199 //--------------------------------------------------------------------------------------------------
201 (
202  const char* appName,
203  ///< [IN] Application name.
204  const char* procName
205  ///< [IN] Process name.
206 )
207 __attribute__(( nonnull(1,2) ));
208 
209 //--------------------------------------------------------------------------------------------------
210 /**
211  * Gets the application name of the process with the specified PID.
212  *
213  * @return
214  * LE_OK if the application name was successfully found.
215  * LE_OVERFLOW if the application name could not fit in the provided buffer.
216  * LE_NOT_FOUND if the process is not part of an application.
217  * LE_FAULT if there was an error.
218  */
219 //--------------------------------------------------------------------------------------------------
221 (
222  int32_t pid,
223  ///< [IN] PID of the process.
224  char* appName,
225  ///< [OUT] Application name.
226  size_t appNameSize
227  ///< [IN]
228 );
229 
230 //--------------------------------------------------------------------------------------------------
231 /**
232  * Gets the application hash as a hexidecimal string. The application hash is a unique hash of the
233  * current version of the application.
234  *
235  * @return
236  * LE_OK if the application has was successfully retrieved.
237  * LE_OVERFLOW if the application hash could not fit in the provided buffer.
238  * LE_NOT_FOUND if the application is not installed.
239  * LE_FAULT if there was an error.
240  *
241  * @note If the application name pointer is null or if its string is empty or of bad format it is a
242  * fatal error, the function will not return.
243  */
244 //--------------------------------------------------------------------------------------------------
246 (
247  const char* appName,
248  ///< [IN] Application name.
249  char* hashStr,
250  ///< [OUT] Hash string.
251  size_t hashStrSize
252  ///< [IN]
253 )
254 __attribute__(( nonnull(1) ));
255 
256 #endif // LE_APPINFO_INTERFACE_H_INCLUDE_GUARD
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
Definition: le_appInfo_interface.h:145
Process is running.
Definition: le_appInfo_interface.h:164
le_result_t le_appInfo_GetHash(const char *appName, char *hashStr, size_t hashStrSize)
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)
le_appInfo_ProcState_t le_appInfo_GetProcState(const char *appName, const char *procName)
Process has been stopped or never started.
Definition: le_appInfo_interface.h:162
le_appInfo_State_t le_appInfo_GetState(const char *appName)
le_result_t le_appInfo_TryConnectService(void)