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 // Internal includes for this interface
51 #include "le_appInfo_common.h"
52 /** @addtogroup le_appInfo le_appInfo API Reference
53  * @{
54  * @file le_appInfo_common.h
55  * @file le_appInfo_interface.h **/
56 //--------------------------------------------------------------------------------------------------
57 /**
58  * Type for handler called when a server disconnects.
59  */
60 //--------------------------------------------------------------------------------------------------
61 typedef void (*le_appInfo_DisconnectHandler_t)(void *);
62 
63 //--------------------------------------------------------------------------------------------------
64 /**
65  *
66  * Connect the current client thread to the service providing this API. Block until the service is
67  * available.
68  *
69  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
70  * called before any other functions in this API. Normally, ConnectService is automatically called
71  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
72  *
73  * This function is created automatically.
74  */
75 //--------------------------------------------------------------------------------------------------
77 (
78  void
79 );
80 
81 //--------------------------------------------------------------------------------------------------
82 /**
83  *
84  * Try to connect the current client thread to the service providing this API. Return with an error
85  * if the service is not available.
86  *
87  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
88  * called before any other functions in this API. Normally, ConnectService is automatically called
89  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
90  *
91  * This function is created automatically.
92  *
93  * @return
94  * - LE_OK if the client connected successfully to the service.
95  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
96  * bound.
97  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
98  * - LE_COMM_ERROR if the Service Directory cannot be reached.
99  */
100 //--------------------------------------------------------------------------------------------------
102 (
103  void
104 );
105 
106 //--------------------------------------------------------------------------------------------------
107 /**
108  * Set handler called when server disconnection is detected.
109  *
110  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
111  * to continue without exiting, it should call longjmp() from inside the handler.
112  */
113 //--------------------------------------------------------------------------------------------------
115 (
116  le_appInfo_DisconnectHandler_t disconnectHandler,
117  void *contextPtr
118 );
119 
120 //--------------------------------------------------------------------------------------------------
121 /**
122  *
123  * Disconnect the current client thread from the service providing this API.
124  *
125  * Normally, this function doesn't need to be called. After this function is called, there's no
126  * longer a connection to the service, and the functions in this API can't be used. For details, see
127  * @ref apiFilesC_client.
128  *
129  * This function is created automatically.
130  */
131 //--------------------------------------------------------------------------------------------------
133 (
134  void
135 );
136 
137 
138 //--------------------------------------------------------------------------------------------------
139 /**
140  * Application states.
141  */
142 //--------------------------------------------------------------------------------------------------
143 
144 
145 //--------------------------------------------------------------------------------------------------
146 /**
147  * Process states.
148  */
149 //--------------------------------------------------------------------------------------------------
150 
151 
152 //--------------------------------------------------------------------------------------------------
153 /**
154  * Gets the state of the specified application. The state of unknown applications is STOPPED.
155  *
156  * @return
157  * The state of the specified application.
158  *
159  * @note If the application name pointer is null or if its string is empty or of bad format it is a
160  * fatal error, the function will not return.
161  */
162 //--------------------------------------------------------------------------------------------------
164 (
165  const char* LE_NONNULL appName
166  ///< [IN] Application name.
167 );
168 
169 //--------------------------------------------------------------------------------------------------
170 /**
171  * Gets the state of the specified process in an application. This function only works for
172  * configured processes that the Supervisor starts directly.
173  *
174  * @return
175  * The state of the specified process.
176  *
177  * @note If the application or process names pointers are null or if their strings are empty or of
178  * bad format it is a fatal error, the function will not return.
179  */
180 //--------------------------------------------------------------------------------------------------
182 (
183  const char* LE_NONNULL appName,
184  ///< [IN] Application name.
185  const char* LE_NONNULL procName
186  ///< [IN] Process name.
187 );
188 
189 //--------------------------------------------------------------------------------------------------
190 /**
191  * Gets the application name of the process with the specified PID.
192  *
193  * @return
194  * LE_OK if the application name was successfully found.
195  * LE_OVERFLOW if the application name could not fit in the provided buffer.
196  * LE_NOT_FOUND if the process is not part of an application.
197  * LE_FAULT if there was an error.
198  */
199 //--------------------------------------------------------------------------------------------------
201 (
202  int32_t pid,
203  ///< [IN] PID of the process.
204  char* appName,
205  ///< [OUT] Application name.
206  size_t appNameSize
207  ///< [IN]
208 );
209 
210 //--------------------------------------------------------------------------------------------------
211 /**
212  * Gets the application hash as a hexidecimal string. The application hash is a unique hash of the
213  * current version of the application.
214  *
215  * @return
216  * LE_OK if the application has was successfully retrieved.
217  * LE_OVERFLOW if the application hash could not fit in the provided buffer.
218  * LE_NOT_FOUND if the application is not installed.
219  * LE_FAULT if there was an error.
220  *
221  * @note If the application name pointer is null or if its string is empty or of bad format it is a
222  * fatal error, the function will not return.
223  */
224 //--------------------------------------------------------------------------------------------------
226 (
227  const char* LE_NONNULL appName,
228  ///< [IN] Application name.
229  char* hashStr,
230  ///< [OUT] Hash string.
231  size_t hashStrSize
232  ///< [IN]
233 );
234 
235 /** @} **/
236 
237 #endif // LE_APPINFO_INTERFACE_H_INCLUDE_GUARD
le_result_t
Definition: le_basics.h:46
le_result_t le_appInfo_GetName(int32_t pid, char *appName, size_t appNameSize)
void le_appInfo_DisconnectService(void)
le_appInfo_ProcState_t le_appInfo_GetProcState(const char *LE_NONNULL appName, const char *LE_NONNULL procName)
le_result_t le_appInfo_GetHash(const char *LE_NONNULL appName, char *hashStr, size_t hashStrSize)
le_appInfo_State_t le_appInfo_GetState(const char *LE_NONNULL appName)
le_appInfo_ProcState_t
Definition: le_appInfo_common.h:58
le_result_t le_appInfo_TryConnectService(void)
void le_appInfo_ConnectService(void)
#define LE_FULL_API
Definition: le_apiFeatures.h:40
LE_FULL_API void le_appInfo_SetServerDisconnectHandler(le_appInfo_DisconnectHandler_t disconnectHandler, void *contextPtr)
le_appInfo_State_t
Definition: le_appInfo_common.h:43
void(* le_appInfo_DisconnectHandler_t)(void *)
Definition: le_appInfo_interface.h:61