le_fwupdate_interface.h

Go to the documentation of this file.
1 /*
2  * ====================== WARNING ======================
3  *
4  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
5  * DO NOT MODIFY IN ANY WAY.
6  *
7  * ====================== WARNING ======================
8  */
9 
10 /**
11  * @page c_fwupdate Modem Firmware Update
12  *
13  * @ref le_fwupdate_interface.h "API Reference"
14  *
15  * <HR>
16  *
17  * Firmware update allows the various firmware images to be updated from the application processor.
18  * This may include the modem bootloader, modem firmware, and linux image, where the linux image
19  * consists of the linux bootloader, linux kernel, and linux rootfs.
20  *
21  * Firmware update is useful when the image comes from an alternative source, rather than as an
22  * over-the-air update through the AirVantage service.
23  *
24  * @todo
25  * - support resuming partial download
26  * - support detailed update status
27  *
28  *
29  * @section le_fwupdate_binding IPC interfaces binding
30  *
31  * All the functions of this API are provided by the @b le_fwupdate service.
32  *
33  * Here's a code sample binding to the le_fwupdate service:
34  * @verbatim
35  bindings:
36  {
37  clientExe.clientComponent.le_fwupdate -> fwupdateService.le_fwupdate
38  }
39  @endverbatim
40  *
41  * @section le_fwupdate_image Update Firmware Image
42  *
43  * The firmware update process is started by calling le_fwupdate_Download(). This function takes
44  * a file descriptor, rather than a file, to provide flexibility in the source of the image. In
45  * particular, this can be used to stream the image, rather than having to save it on the file
46  * system before doing the update.
47  *
48  * If the image is successfully downloaded, a reset will occur in order to apply
49  * the update. This will reset all processors. After the application
50  * processor has restarted, the @ref le_info_version APIs can be used to determine whether
51  * the firmware has been updated to the new version.
52  *
53  * <HR>
54  *
55  * Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
56  */
57 /**
58  * @file le_fwupdate_interface.h
59  *
60  * Legato @ref c_fwupdate include file.
61  *
62  * Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
63  */
64 
65 #ifndef LE_FWUPDATE_INTERFACE_H_INCLUDE_GUARD
66 #define LE_FWUPDATE_INTERFACE_H_INCLUDE_GUARD
67 
68 
69 #include "legato.h"
70 
71 //--------------------------------------------------------------------------------------------------
72 /**
73  *
74  * Connect the current client thread to the service providing this API. Block until the service is
75  * available.
76  *
77  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
78  * called before any other functions in this API. Normally, ConnectService is automatically called
79  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
80  *
81  * This function is created automatically.
82  */
83 //--------------------------------------------------------------------------------------------------
85 (
86  void
87 );
88 
89 //--------------------------------------------------------------------------------------------------
90 /**
91  *
92  * Try to connect the current client thread to the service providing this API. Return with an error
93  * if the service is not available.
94  *
95  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
96  * called before any other functions in this API. Normally, ConnectService is automatically called
97  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
98  *
99  * This function is created automatically.
100  *
101  * @return
102  * - LE_OK if the client connected successfully to the service.
103  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
104  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
105  * - LE_COMM_ERROR if the Service Directory cannot be reached.
106  */
107 //--------------------------------------------------------------------------------------------------
109 (
110  void
111 );
112 
113 //--------------------------------------------------------------------------------------------------
114 /**
115  *
116  * Disconnect the current client thread from the service providing this API.
117  *
118  * Normally, this function doesn't need to be called. After this function is called, there's no
119  * longer a connection to the service, and the functions in this API can't be used. For details, see
120  * @ref apiFilesC_client.
121  *
122  * This function is created automatically.
123  */
124 //--------------------------------------------------------------------------------------------------
126 (
127  void
128 );
129 
130 
131 //--------------------------------------------------------------------------------------------------
132 /**
133  * Maximum length of a version string, excluding any termination character.
134  */
135 //--------------------------------------------------------------------------------------------------
136 #define LE_FWUPDATE_MAX_VERS_LEN 256
137 
138 //--------------------------------------------------------------------------------------------------
139 /**
140  * Download the firmware image file.
141  *
142  * @return
143  * - LE_OK on success
144  * - LE_BAD_PARAMETER if an input parameter is not valid
145  * - LE_FAULT on failure
146  *
147  * @note
148  * The process exits, if an invalid file descriptor (e.g. negative) is given.
149  */
150 //--------------------------------------------------------------------------------------------------
152 (
153  int fd
154  ///< [IN] File descriptor of the image, opened to the start of the image.
155 );
156 
157 //--------------------------------------------------------------------------------------------------
158 /**
159  * Get the firmware version string
160  *
161  * @return
162  * - LE_OK on success
163  * - LE_NOT_FOUND if the version string is not available
164  * - LE_OVERFLOW if version string to big to fit in provided buffer
165  * - LE_FAULT for any other errors
166  */
167 //--------------------------------------------------------------------------------------------------
169 (
170  char* version,
171  ///< [OUT] Firmware version string
172 
173  size_t versionNumElements
174  ///< [IN]
175 );
176 
177 //--------------------------------------------------------------------------------------------------
178 /**
179  * Get the bootloader version string
180  *
181  * @return
182  * - LE_OK on success
183  * - LE_NOT_FOUND if the version string is not available
184  * - LE_OVERFLOW if version string to big to fit in provided buffer
185  * - LE_FAULT for any other errors
186  */
187 //--------------------------------------------------------------------------------------------------
189 (
190  char* version,
191  ///< [OUT] Bootloader version string
192 
193  size_t versionNumElements
194  ///< [IN]
195 );
196 
197 
198 #endif // LE_FWUPDATE_INTERFACE_H_INCLUDE_GUARD
199 
void le_fwupdate_ConnectService(void)
le_result_t
Definition: le_basics.h:35
le_result_t le_fwupdate_GetBootloaderVersion(char *version, size_t versionNumElements)
le_result_t le_fwupdate_Download(int fd)
le_result_t le_fwupdate_TryConnectService(void)
le_result_t le_fwupdate_GetFirmwareVersion(char *version, size_t versionNumElements)
void le_fwupdate_DisconnectService(void)