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 //--------------------------------------------------------------------------------------------------
95 /**
96  * Type for handler called when a server disconnects.
97  */
98 //--------------------------------------------------------------------------------------------------
99 typedef void (*le_dualsys_DisconnectHandler_t)(void *);
100 
101 //--------------------------------------------------------------------------------------------------
102 /**
103  *
104  * Connect the current client thread to the service providing this API. Block until the service is
105  * available.
106  *
107  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
108  * called before any other functions in this API. Normally, ConnectService is automatically called
109  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
110  *
111  * This function is created automatically.
112  */
113 //--------------------------------------------------------------------------------------------------
115 (
116  void
117 );
118 
119 //--------------------------------------------------------------------------------------------------
120 /**
121  *
122  * Try to connect the current client thread to the service providing this API. Return with an error
123  * if the service is not available.
124  *
125  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
126  * called before any other functions in this API. Normally, ConnectService is automatically called
127  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
128  *
129  * This function is created automatically.
130  *
131  * @return
132  * - LE_OK if the client connected successfully to the service.
133  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
134  * bound.
135  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
136  * - LE_COMM_ERROR if the Service Directory cannot be reached.
137  */
138 //--------------------------------------------------------------------------------------------------
140 (
141  void
142 );
143 
144 //--------------------------------------------------------------------------------------------------
145 /**
146  * Set handler called when server disconnection is detected.
147  *
148  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
149  * to continue without exiting, it should call longjmp() from inside the handler.
150  */
151 //--------------------------------------------------------------------------------------------------
153 (
154  le_dualsys_DisconnectHandler_t disconnectHandler,
155  void *contextPtr
156 );
157 
158 //--------------------------------------------------------------------------------------------------
159 /**
160  *
161  * Disconnect the current client thread from the service providing this API.
162  *
163  * Normally, this function doesn't need to be called. After this function is called, there's no
164  * longer a connection to the service, and the functions in this API can't be used. For details, see
165  * @ref apiFilesC_client.
166  *
167  * This function is created automatically.
168  */
169 //--------------------------------------------------------------------------------------------------
171 (
172  void
173 );
174 
175 
176 //--------------------------------------------------------------------------------------------------
177 /**
178  * System
179  * Define on which system 1 or 2 belong the partition group (0 = system 1, 1 = system 2)
180  */
181 //--------------------------------------------------------------------------------------------------
182 
183 
184 //--------------------------------------------------------------------------------------------------
185 /**
186  * Disable (true) or enable (false) the synchronisation check before performing an update.
187  * The default behavior at startup is always to have the check enabled. It remains enabled
188  * until this service is called with the value true. To re-enable the synchronization check
189  * call this service with the value false.
190  *
191  * @note Upgrading some partitions without performing a sync before may let the whole system
192  * into a unworkable state. THIS IS THE RESPONSABILITY OF THE CALLER TO KNOW WHAT IMAGES
193  * ARE ALREADY FLASHED INTO THE UPDATE SYSTEM.
194  *
195  * @note Fuction must be called after each target reboot or updateDaemon restart
196  *
197  * @return
198  * - LE_OK On success
199  * - LE_UNSUPPORTED The feature is not supported
200  * - LE_FAULT On failure
201  */
202 //--------------------------------------------------------------------------------------------------
204 (
205  bool isDisabled
206  ///< [IN] State of sync check : true (disable) or false (enable)
207 );
208 
209 //--------------------------------------------------------------------------------------------------
210 /**
211  * Define a new "system" by setting the three sub-systems. This system will become the current
212  * system in use after the reset performed by this service, if no error are reported.
213  *
214  * @note On success, a device reboot is initiated without returning any value.
215  *
216  * @return
217  * - LE_FAULT On failure
218  * - LE_UNSUPPORTED The feature is not supported
219  */
220 //--------------------------------------------------------------------------------------------------
222 (
223  le_dualsys_System_t systemMask
224  ///< [IN] Sub-system bitmask for "modem/lk/linux" partitions
225 );
226 
227 //--------------------------------------------------------------------------------------------------
228 /**
229  * Get the current "system" in use.
230  *
231  * @return
232  * - LE_OK On success
233  * - LE_FAULT On failure
234  * - LE_UNSUPPORTED The feature is not supported
235  */
236 //--------------------------------------------------------------------------------------------------
238 (
239  le_dualsys_System_t* systemMaskPtr
240  ///< [OUT] Sub-system bitmask for "modem/lk/linux" partitions
241 );
242 
243 #endif // LE_DUALSYS_INTERFACE_H_INCLUDE_GUARD
le_result_t
Definition: le_basics.h:35
LE_FULL_API void le_dualsys_SetServerDisconnectHandler(le_dualsys_DisconnectHandler_t disconnectHandler, void *contextPtr)
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_DisconnectHandler_t)(void *)
Definition: le_dualsys_interface.h:99
void le_dualsys_ConnectService(void)
#define LE_FULL_API
Definition: le_apiFeatures.h:40
void le_dualsys_DisconnectService(void)
le_result_t le_dualsys_GetCurrentSystem(le_dualsys_System_t *systemMaskPtr)