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