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