logFd_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_logFd File Descriptor Logging API
14  *
15  * @ref logFd_interface.h "API Reference"
16  *
17  * This API provides a method for logging messages coming from a file descriptor such as a pipe or
18  * socket. This API MUST only be used by the Supervisor.
19  *
20  * <HR>
21  *
22  * Copyright (C) Sierra Wireless Inc.
23  */
24 /**
25  * @file logFd_interface.h
26  *
27  * Legato @ref c_logFd include file.
28  *
29  * Copyright (C) Sierra Wireless Inc.
30  */
31 
32 #ifndef LOGFD_INTERFACE_H_INCLUDE_GUARD
33 #define LOGFD_INTERFACE_H_INCLUDE_GUARD
34 
35 
36 #include "legato.h"
37 
38 // Interface specific includes
39 #include "le_limit_interface.h"
40 
41 
42 //--------------------------------------------------------------------------------------------------
43 /**
44  * Type for handler called when a server disconnects.
45  */
46 //--------------------------------------------------------------------------------------------------
47 typedef void (*logFd_DisconnectHandler_t)(void *);
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
82  * bound.
83  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
84  * - LE_COMM_ERROR if the Service Directory cannot be reached.
85  */
86 //--------------------------------------------------------------------------------------------------
88 (
89  void
90 );
91 
92 //--------------------------------------------------------------------------------------------------
93 /**
94  * Set handler called when server disconnection is detected.
95  *
96  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
97  * to continue without exiting, it should call longjmp() from inside the handler.
98  */
99 //--------------------------------------------------------------------------------------------------
101 (
102  logFd_DisconnectHandler_t disconnectHandler,
103  void *contextPtr
104 );
105 
106 //--------------------------------------------------------------------------------------------------
107 /**
108  *
109  * Disconnect the current client thread from the service providing this API.
110  *
111  * Normally, this function doesn't need to be called. After this function is called, there's no
112  * longer a connection to the service, and the functions in this API can't be used. For details, see
113  * @ref apiFilesC_client.
114  *
115  * This function is created automatically.
116  */
117 //--------------------------------------------------------------------------------------------------
119 (
120  void
121 );
122 
123 
124 //--------------------------------------------------------------------------------------------------
125 /**
126  * Registers an application process' standard error for logging. Messages from this file descriptor
127  * will be logged at LE_LOG_ERR level.
128  *
129  * @return
130  * LE_OK if successful.
131  * LE_FAULT if there was an error.
132  */
133 //--------------------------------------------------------------------------------------------------
134 void logFd_StdErr
135 (
136  int fd,
137  ///< [IN] stderr file descriptor.
138  const char* appName,
139  ///< [IN] Name of the application.
140  const char* procName,
141  ///< [IN] Name of the process.
142  int32_t pid
143  ///< [IN] PID of the process.
144 )
145 __attribute__(( nonnull(2,3) ));
146 
147 //--------------------------------------------------------------------------------------------------
148 /**
149  * Registers an application process' standard out for logging. Messages from this file descriptor
150  * will be logged at LE_LOG_INFO level.
151  *
152  * @return
153  * LE_OK if successful.
154  * LE_FAULT if there was an error.
155  */
156 //--------------------------------------------------------------------------------------------------
157 void logFd_StdOut
158 (
159  int fd,
160  ///< [IN] stdout file descriptor.
161  const char* appName,
162  ///< [IN] Name of the application.
163  const char* procName,
164  ///< [IN] Name of the process.
165  int32_t pid
166  ///< [IN] PID of the process.
167 )
168 __attribute__(( nonnull(2,3) ));
169 
170 #endif // LOGFD_INTERFACE_H_INCLUDE_GUARD
void logFd_ConnectService(void)
le_result_t
Definition: le_basics.h:35
le_result_t logFd_TryConnectService(void)
void logFd_StdErr(int fd, const char *appName, const char *procName, int32_t pid)
void logFd_StdOut(int fd, const char *appName, const char *procName, int32_t pid)
void(* logFd_DisconnectHandler_t)(void *)
Definition: logFd_interface.h:47
void logFd_SetServerDisconnectHandler(logFd_DisconnectHandler_t disconnectHandler, void *contextPtr)
void logFd_DisconnectService(void)