le_appInfo_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_appInfo_common.h
12  *
13  * Type definitions for le_appInfo.
14  *
15  */
16 #ifndef LE_APPINFO_COMMON_H_INCLUDE_GUARD
17 #define LE_APPINFO_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_limit_common.h"
24 
25 #define IFGEN_LE_APPINFO_PROTOCOL_ID "092c2f7994c22cecc1e5a2608e1595b0"
26 #define IFGEN_LE_APPINFO_MSG_SIZE 110
27 /** @addtogroup le_appInfo
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * Length of an MD5 hash string.
34  */
35 //--------------------------------------------------------------------------------------------------
36 #define LE_APPINFO_MD5_STR_LEN 32
37 
38 //--------------------------------------------------------------------------------------------------
39 /**
40  * Application states.
41  */
42 //--------------------------------------------------------------------------------------------------
43 typedef enum
44 {
46  ///< Application has been stopped or never started.
48  ///< Application is running.
49 }
51 
52 
53 //--------------------------------------------------------------------------------------------------
54 /**
55  * Process states.
56  */
57 //--------------------------------------------------------------------------------------------------
58 typedef enum
59 {
61  ///< Process has been stopped or never started.
63  ///< Process is running.
64 }
66 
67 
68 
69 //--------------------------------------------------------------------------------------------------
70 /**
71  * Get if this client bound locally.
72  */
73 //--------------------------------------------------------------------------------------------------
74 LE_SHARED bool ifgen_le_appInfo_HasLocalBinding
75 (
76  void
77 );
78 
79 
80 //--------------------------------------------------------------------------------------------------
81 /**
82  * Init data that is common across all threads
83  */
84 //--------------------------------------------------------------------------------------------------
85 LE_SHARED void ifgen_le_appInfo_InitCommonData
86 (
87  void
88 );
89 
90 
91 //--------------------------------------------------------------------------------------------------
92 /**
93  * Perform common initialization and open a session
94  */
95 //--------------------------------------------------------------------------------------------------
96 LE_SHARED le_result_t ifgen_le_appInfo_OpenSession
97 (
98  le_msg_SessionRef_t _ifgen_sessionRef,
99  bool isBlocking
100 );
101 
102 //--------------------------------------------------------------------------------------------------
103 /**
104  * Gets the state of the specified application. The state of unknown applications is STOPPED.
105  *
106  * @return
107  * The state of the specified application.
108  *
109  * @note If the application name pointer is null or if its string is empty or of bad format it is a
110  * fatal error, the function will not return.
111  */
112 //--------------------------------------------------------------------------------------------------
113 LE_SHARED le_appInfo_State_t ifgen_le_appInfo_GetState
114 (
115  le_msg_SessionRef_t _ifgen_sessionRef,
116  const char* LE_NONNULL appName
117  ///< [IN] Application name.
118 );
119 
120 //--------------------------------------------------------------------------------------------------
121 /**
122  * Gets the state of the specified process in an application. This function only works for
123  * configured processes that the Supervisor starts directly.
124  *
125  * @return
126  * The state of the specified process.
127  *
128  * @note If the application or process names pointers are null or if their strings are empty or of
129  * bad format it is a fatal error, the function will not return.
130  */
131 //--------------------------------------------------------------------------------------------------
132 LE_SHARED le_appInfo_ProcState_t ifgen_le_appInfo_GetProcState
133 (
134  le_msg_SessionRef_t _ifgen_sessionRef,
135  const char* LE_NONNULL appName,
136  ///< [IN] Application name.
137  const char* LE_NONNULL procName
138  ///< [IN] Process name.
139 );
140 
141 //--------------------------------------------------------------------------------------------------
142 /**
143  * Gets the application name of the process with the specified PID.
144  *
145  * @return
146  * LE_OK if the application name was successfully found.
147  * LE_OVERFLOW if the application name could not fit in the provided buffer.
148  * LE_NOT_FOUND if the process is not part of an application.
149  * LE_FAULT if there was an error.
150  */
151 //--------------------------------------------------------------------------------------------------
152 LE_SHARED le_result_t ifgen_le_appInfo_GetName
153 (
154  le_msg_SessionRef_t _ifgen_sessionRef,
155  int32_t pid,
156  ///< [IN] PID of the process.
157  char* appName,
158  ///< [OUT] Application name.
159  size_t appNameSize
160  ///< [IN]
161 );
162 
163 //--------------------------------------------------------------------------------------------------
164 /**
165  * Gets the application hash as a hexidecimal string. The application hash is a unique hash of the
166  * current version of the application.
167  *
168  * @return
169  * LE_OK if the application has was successfully retrieved.
170  * LE_OVERFLOW if the application hash could not fit in the provided buffer.
171  * LE_NOT_FOUND if the application is not installed.
172  * LE_FAULT if there was an error.
173  *
174  * @note If the application name pointer is null or if its string is empty or of bad format it is a
175  * fatal error, the function will not return.
176  */
177 //--------------------------------------------------------------------------------------------------
178 LE_SHARED le_result_t ifgen_le_appInfo_GetHash
179 (
180  le_msg_SessionRef_t _ifgen_sessionRef,
181  const char* LE_NONNULL appName,
182  ///< [IN] Application name.
183  char* hashStr,
184  ///< [OUT] Hash string.
185  size_t hashStrSize
186  ///< [IN]
187 );
188 /** @} **/
189 #endif // LE_APPINFO_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:287
le_result_t
Definition: le_basics.h:46
Process is running.
Definition: le_appInfo_common.h:62
le_appInfo_ProcState_t
Definition: le_appInfo_common.h:58
Application is running.
Definition: le_appInfo_common.h:47
Application has been stopped or never started.
Definition: le_appInfo_common.h:45
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
le_appInfo_State_t
Definition: le_appInfo_common.h:43
Process has been stopped or never started.
Definition: le_appInfo_common.h:60