le_kernelModule_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_kernelModule Linux Kernel Module API
14  *
15  * @ref le_kernelModule_interface.h "API Reference"
16  *
17  * This API provides a way for applications to manually load and unload modules that were bundled
18  * with their system.
19  *
20  * Module dependencies and running module load scripts are handled automatically. Only the name of
21  * the module in question is required.
22  *
23  * To load a module, call @c le_kernelModule_Load. Unloading is similarly handled by
24  * @c le_kernelModule_Unload
25  *
26  * An example for loading a module:
27  *
28  * @code
29  * le_result_t result = le_kernelModule_Load(moduleName);
30  *
31  * LE_FATAL_IF(result != LE_OK, "Could not load the required module, %s.", moduleName);
32  *
33  * LE_INFO("Module, %s has been loaded.", moduleName);
34  * @endcode
35  *
36  * Copyright (C) Sierra Wireless Inc.
37  */
38 
39 #ifndef LE_KERNELMODULE_INTERFACE_H_INCLUDE_GUARD
40 #define LE_KERNELMODULE_INTERFACE_H_INCLUDE_GUARD
41 
42 
43 #include "legato.h"
44 
45 // Internal includes for this interface
46 #include "le_kernelModule_common.h"
47 /** @addtogroup le_kernelModule le_kernelModule API Reference
48  * @{
49  * @file le_kernelModule_common.h
50  * @file le_kernelModule_interface.h **/
51 //--------------------------------------------------------------------------------------------------
52 /**
53  * Type for handler called when a server disconnects.
54  */
55 //--------------------------------------------------------------------------------------------------
56 typedef void (*le_kernelModule_DisconnectHandler_t)(void *);
57 
58 //--------------------------------------------------------------------------------------------------
59 /**
60  *
61  * Connect the current client thread to the service providing this API. Block until the service is
62  * available.
63  *
64  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
65  * called before any other functions in this API. Normally, ConnectService is automatically called
66  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
67  *
68  * This function is created automatically.
69  */
70 //--------------------------------------------------------------------------------------------------
72 (
73  void
74 );
75 
76 //--------------------------------------------------------------------------------------------------
77 /**
78  *
79  * Try to connect the current client thread to the service providing this API. Return with an error
80  * if the service is not available.
81  *
82  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
83  * called before any other functions in this API. Normally, ConnectService is automatically called
84  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
85  *
86  * This function is created automatically.
87  *
88  * @return
89  * - LE_OK if the client connected successfully to the service.
90  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
91  * bound.
92  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
93  * - LE_COMM_ERROR if the Service Directory cannot be reached.
94  */
95 //--------------------------------------------------------------------------------------------------
97 (
98  void
99 );
100 
101 //--------------------------------------------------------------------------------------------------
102 /**
103  * Set handler called when server disconnection is detected.
104  *
105  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
106  * to continue without exiting, it should call longjmp() from inside the handler.
107  */
108 //--------------------------------------------------------------------------------------------------
110 (
111  le_kernelModule_DisconnectHandler_t disconnectHandler,
112  void *contextPtr
113 );
114 
115 //--------------------------------------------------------------------------------------------------
116 /**
117  *
118  * Disconnect the current client thread from the service providing this API.
119  *
120  * Normally, this function doesn't need to be called. After this function is called, there's no
121  * longer a connection to the service, and the functions in this API can't be used. For details, see
122  * @ref apiFilesC_client.
123  *
124  * This function is created automatically.
125  */
126 //--------------------------------------------------------------------------------------------------
128 (
129  void
130 );
131 
132 
133 //--------------------------------------------------------------------------------------------------
134 /**
135  * Load the specified kernel module that was bundled with a Legato system.
136  *
137  * @return
138  * - LE_OK if the module has been successfully loaded into the kernel.
139  * - LE_NOT_FOUND if the named module was not found in the system.
140  * - LE_FAULT if errors were encountered when loading the module, or one of the module's
141  * dependencies.
142  * - LE_DUPLICATE if the module has been already loaded into the kernel.
143  */
144 //--------------------------------------------------------------------------------------------------
146 (
147  const char* LE_NONNULL moduleName
148  ///< [IN] Name of the module to load.
149 );
150 
151 //--------------------------------------------------------------------------------------------------
152 /**
153  * Unload the specified module. The module to be unloaded must be one that was bundled with the
154  * system.
155  *
156  * @return
157  * - LE_OK if the module has been successfully unloaded from the kernel.
158  * - LE_NOT_FOUND if the named module was not found in the system.
159  * - LE_FAULT if errors were encountered during the module, or one of the module's dependencies
160  * unloading.
161  * - LE_DUPLICATE if the module has been already unloaded from the kernel.
162  */
163 //--------------------------------------------------------------------------------------------------
165 (
166  const char* LE_NONNULL moduleName
167  ///< [IN] Name of the module to unload.
168 );
169 
170 /** @} **/
171 
172 #endif // LE_KERNELMODULE_INTERFACE_H_INCLUDE_GUARD
void(* le_kernelModule_DisconnectHandler_t)(void *)
Definition: le_kernelModule_interface.h:56
le_result_t
Definition: le_basics.h:46
LE_FULL_API void le_kernelModule_SetServerDisconnectHandler(le_kernelModule_DisconnectHandler_t disconnectHandler, void *contextPtr)
le_result_t le_kernelModule_Unload(const char *LE_NONNULL moduleName)
#define LE_FULL_API
Definition: le_apiFeatures.h:40
void le_kernelModule_DisconnectService(void)
le_result_t le_kernelModule_Load(const char *LE_NONNULL moduleName)
void le_kernelModule_ConnectService(void)
le_result_t le_kernelModule_TryConnectService(void)