le_dualsys_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_le_dualsys Dual Systems Update API
14  *
15  * @ref le_dualsys_interface.h "API Reference"
16  *
17  *
18  * Dual systems are systems composed with two set of partitions: one is said "ACTIVE", so currently
19  * in use, and the other said "UPDATE", so not used but ready-to-use.
20  *
21  * On dual systems, when Legato updates an image through the le_fwupdate API, it works on the
22  * UPDATE system.
23  * And then an "install" command performs a switch from UPDATE to ACTIVE after a reboot:
24  * The new ACTIVE system is used. The UPDATE partition becomes ready for a new update or for
25  * roll-back if the new ACTIVE fails to start properly.
26  *
27  * In each set, three sub-systems are defined:
28  * - The "modem" group for all binaries and filesystem related to modem core,
29  * - The "lk" group for the LK bootloader,
30  * - The "linux" group the kernel, rootfs and legato partitions.
31  *
32  * @section le_dualsys_binding IPC interfaces binding
33  *
34  * All the functions of this API are provided by the @b le_dualsys service.
35  *
36  * Here's a code sample binding to the le_dualsys service:
37  * @verbatim
38  bindings:
39  {
40  clientExe.clientComponent.le_dualsys -> fwupdateService.le_dualsys
41  }
42  @endverbatim
43  *
44  *
45  * @warning All of these APIs are only available for all dual systems platforms. Please refer
46  * to the Product Technical Specification document of your platform for further details.
47  * Please refer to @subpage platformConstraintsFwUpdate for details.
48  *
49  * @section le_dualsys_DisableSyncBeforeUpdate Disable the check of sync before updating
50  *
51  * It is possible to force the update of any partition even if the systems are not synchronized.
52  * This is done by calling le_fwupdate_DisableSyncBeforeUpdate() with the value true. If the value
53  * is false, the synchronization will be mandatory before performing an update.
54  * Note that the synchronization is automatically done by calling the function
55  * le_fwupdate_InitDownload() when the synchronization check is enabled.
56  *
57  * @section le_dualsys_system Defining a System
58  *
59  * It is possible to define a system by calling le_dualsys_SetSystem(). This function takes
60  * three values, one for the modem sub-system, one for the lk sub-system and one for the linux
61  * sub-system. The values are one of 0 for system 1 or 1 for system 2. When set, the system will
62  * be usable after the next reset.
63  * If no error is encountered, this function will perform a reset.
64  *
65  * It is possible the get the last defined system by calling the le_dualsys_GetSystem(). This
66  * function returns the values for the three sub-systems. This system is updated accordingly
67  * the last system set by le_dualsys_SetSystem().
68  *
69  * It is possible to get the current active system by calling le_dualsys_GetCurrentSystem().
70  * This function returns the values for the three sub-systems. If le_dualsys_SetSystem() is
71  * called before le_dualsys_GetCurrentSystem(), the returned values may differ as they represent
72  * the current system in use.
73  *
74  * <HR>
75  *
76  * Copyright (C) Sierra Wireless Inc.
77  */
78 /**
79  * @file le_dualsys_interface.h
80  *
81  * Legato @ref c_le_dualsys include file.
82  *
83  * Copyright (C) Sierra Wireless Inc.
84  */
85 
86 #ifndef LE_DUALSYS_INTERFACE_H_INCLUDE_GUARD
87 #define LE_DUALSYS_INTERFACE_H_INCLUDE_GUARD
88 
89 
90 #include "legato.h"
91 
92 // Internal includes for this interface
93 #include "le_dualsys_common.h"
94 /** @addtogroup le_dualsys le_dualsys API Reference
95  * @{
96  * @file le_dualsys_common.h
97  * @file le_dualsys_interface.h **/
98 //--------------------------------------------------------------------------------------------------
99 /**
100  * Type for handler called when a server disconnects.
101  */
102 //--------------------------------------------------------------------------------------------------
103 typedef void (*le_dualsys_DisconnectHandler_t)(void *);
104 
105 //--------------------------------------------------------------------------------------------------
106 /**
107  *
108  * Connect the current client thread to the service providing this API. Block until the service is
109  * available.
110  *
111  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
112  * called before any other functions in this API. Normally, ConnectService is automatically called
113  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
114  *
115  * This function is created automatically.
116  */
117 //--------------------------------------------------------------------------------------------------
119 (
120  void
121 );
122 
123 //--------------------------------------------------------------------------------------------------
124 /**
125  *
126  * Try to connect the current client thread to the service providing this API. Return with an error
127  * if the service is not available.
128  *
129  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
130  * called before any other functions in this API. Normally, ConnectService is automatically called
131  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
132  *
133  * This function is created automatically.
134  *
135  * @return
136  * - LE_OK if the client connected successfully to the service.
137  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
138  * bound.
139  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
140  * - LE_COMM_ERROR if the Service Directory cannot be reached.
141  */
142 //--------------------------------------------------------------------------------------------------
144 (
145  void
146 );
147 
148 //--------------------------------------------------------------------------------------------------
149 /**
150  * Set handler called when server disconnection is detected.
151  *
152  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
153  * to continue without exiting, it should call longjmp() from inside the handler.
154  */
155 //--------------------------------------------------------------------------------------------------
157 (
158  le_dualsys_DisconnectHandler_t disconnectHandler,
159  void *contextPtr
160 );
161 
162 //--------------------------------------------------------------------------------------------------
163 /**
164  *
165  * Disconnect the current client thread from the service providing this API.
166  *
167  * Normally, this function doesn't need to be called. After this function is called, there's no
168  * longer a connection to the service, and the functions in this API can't be used. For details, see
169  * @ref apiFilesC_client.
170  *
171  * This function is created automatically.
172  */
173 //--------------------------------------------------------------------------------------------------
175 (
176  void
177 );
178 
179 
180 //--------------------------------------------------------------------------------------------------
181 /**
182  * System
183  * Define on which system 1 or 2 belong the partition group (0 = system 1, 1 = system 2)
184  */
185 //--------------------------------------------------------------------------------------------------
186 
187 
188 //--------------------------------------------------------------------------------------------------
189 /**
190  * Disable (true) or enable (false) the synchronisation check before performing an update.
191  * The default behavior at startup is always to have the check enabled. It remains enabled
192  * until this service is called with the value true. To re-enable the synchronization check
193  * call this service with the value false.
194  *
195  * @note Upgrading some partitions without performing a sync before may let the whole system
196  * into a unworkable state. THIS IS THE RESPONSABILITY OF THE CALLER TO KNOW WHAT IMAGES
197  * ARE ALREADY FLASHED INTO THE UPDATE SYSTEM.
198  *
199  * @note Fuction must be called after each target reboot or updateDaemon restart
200  *
201  * @return
202  * - LE_OK On success
203  * - LE_UNSUPPORTED The feature is not supported
204  * - LE_FAULT On failure
205  */
206 //--------------------------------------------------------------------------------------------------
208 (
209  bool isDisabled
210  ///< [IN] State of sync check : true (disable) or false (enable)
211 );
212 
213 //--------------------------------------------------------------------------------------------------
214 /**
215  * Define a new "system" by setting the three sub-systems. This system will become the current
216  * system in use after the reset performed by this service, if no error are reported.
217  *
218  * @note On success, a device reboot is initiated without returning any value.
219  *
220  * @return
221  * - LE_FAULT On failure
222  * - LE_UNSUPPORTED The feature is not supported
223  */
224 //--------------------------------------------------------------------------------------------------
226 (
227  le_dualsys_System_t systemMask
228  ///< [IN] Sub-system bitmask for "modem/lk/linux" partitions
229 );
230 
231 //--------------------------------------------------------------------------------------------------
232 /**
233  * Get the current "system" in use.
234  *
235  * @return
236  * - LE_OK On success
237  * - LE_FAULT On failure
238  * - LE_UNSUPPORTED The feature is not supported
239  */
240 //--------------------------------------------------------------------------------------------------
242 (
243  le_dualsys_System_t* systemMaskPtr
244  ///< [OUT] Sub-system bitmask for "modem/lk/linux" partitions
245 );
246 
247 /** @} **/
248 
249 #endif // LE_DUALSYS_INTERFACE_H_INCLUDE_GUARD
le_result_t
Definition: le_basics.h:46
le_result_t le_dualsys_GetCurrentSystem(le_dualsys_System_t *systemMaskPtr)
void le_dualsys_ConnectService(void)
LE_FULL_API void le_dualsys_SetServerDisconnectHandler(le_dualsys_DisconnectHandler_t disconnectHandler, void *contextPtr)
void(* le_dualsys_DisconnectHandler_t)(void *)
Definition: le_dualsys_interface.h:103
#define LE_FULL_API
Definition: le_apiFeatures.h:40
le_result_t le_dualsys_SetSystem(le_dualsys_System_t systemMask)
le_result_t le_dualsys_DisableSyncBeforeUpdate(bool isDisabled)
le_result_t le_dualsys_TryConnectService(void)
void le_dualsys_DisconnectService(void)