le_flash_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_flash Flash API
14  *
15  * @ref le_flash_interface.h "API Reference"
16  *
17  * <HR>
18  *
19  * This file contains data structures and prototypes definitions for high level Flash APIs.
20  *
21  * @section le_flash_binding IPC interfaces binding
22  *
23  * All the functions of this API are provided by the @b flashService.
24  *
25  * Here's a code sample binding to the flash service:
26  * @verbatim
27  bindings:
28  {
29  clientExe.clientComponent.le_flash -> fwupdateService.le_flash
30  }
31  @endverbatim
32  *
33  * @warning These APIs are not available for all platforms. Please refer to the Product Technical
34  * Specification document of your platform for further details.
35  * Please refer to @subpage platformConstraintsFlash for details.
36  *
37  * @section le_flash_BadImageDetection Bad image detection
38  *
39  * This functionality allows the user to be notified when an image becomes bad.
40  *
41  * - le_flash_AddBadImageDetectionHandler() API adds a handler to notify when an image becomes bad
42  * - le_flash_RemoveBadImageDetectionHandler() API removes the bad image handler
43  *
44  * <HR>
45  *
46  * Copyright (C) Sierra Wireless Inc.
47  */
48 /**
49  * @file le_flash_interface.h
50  *
51  * Legato @ref c_flash include file.
52  *
53  * Copyright (C) Sierra Wireless Inc.
54  */
55 
56 #ifndef LE_FLASH_INTERFACE_H_INCLUDE_GUARD
57 #define LE_FLASH_INTERFACE_H_INCLUDE_GUARD
58 
59 
60 #include "legato.h"
61 
62 
63 //--------------------------------------------------------------------------------------------------
64 /**
65  * Type for handler called when a server disconnects.
66  */
67 //--------------------------------------------------------------------------------------------------
68 typedef void (*le_flash_DisconnectHandler_t)(void *);
69 
70 //--------------------------------------------------------------------------------------------------
71 /**
72  *
73  * Connect the current client thread to the service providing this API. Block until the service is
74  * available.
75  *
76  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
77  * called before any other functions in this API. Normally, ConnectService is automatically called
78  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
79  *
80  * This function is created automatically.
81  */
82 //--------------------------------------------------------------------------------------------------
84 (
85  void
86 );
87 
88 //--------------------------------------------------------------------------------------------------
89 /**
90  *
91  * Try to connect the current client thread to the service providing this API. Return with an error
92  * if the service is not available.
93  *
94  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
95  * called before any other functions in this API. Normally, ConnectService is automatically called
96  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
97  *
98  * This function is created automatically.
99  *
100  * @return
101  * - LE_OK if the client connected successfully to the service.
102  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
103  * 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  * Set handler called when server disconnection is detected.
116  *
117  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
118  * to continue without exiting, it should call longjmp() from inside the handler.
119  */
120 //--------------------------------------------------------------------------------------------------
122 (
123  le_flash_DisconnectHandler_t disconnectHandler,
124  void *contextPtr
125 );
126 
127 //--------------------------------------------------------------------------------------------------
128 /**
129  *
130  * Disconnect the current client thread from the service providing this API.
131  *
132  * Normally, this function doesn't need to be called. After this function is called, there's no
133  * longer a connection to the service, and the functions in this API can't be used. For details, see
134  * @ref apiFilesC_client.
135  *
136  * This function is created automatically.
137  */
138 //--------------------------------------------------------------------------------------------------
140 (
141  void
142 );
143 
144 
145 //--------------------------------------------------------------------------------------------------
146 /**
147  * Image length maximum length.
148  *
149  */
150 //--------------------------------------------------------------------------------------------------
151 #define LE_FLASH_IMAGE_NAME_MAX_LEN 32
152 
153 //--------------------------------------------------------------------------------------------------
154 /**
155  * Image length maximum length.
156  * One extra byte is added for the null character.
157  */
158 //--------------------------------------------------------------------------------------------------
159 #define LE_FLASH_IMAGE_NAME_MAX_BYTES 33
160 
161 //--------------------------------------------------------------------------------------------------
162 /**
163  * Reference type used by Add/Remove functions for EVENT 'le_flash_BadImageDetection'
164  */
165 //--------------------------------------------------------------------------------------------------
166 typedef struct le_flash_BadImageDetectionHandler* le_flash_BadImageDetectionHandlerRef_t;
167 
168 
169 //--------------------------------------------------------------------------------------------------
170 /**
171  * Handler for bad image detection.
172  *
173  * @note The image names are platform dependent.
174  */
175 //--------------------------------------------------------------------------------------------------
177 (
178  const char* LE_NONNULL imageName,
179  ///< bad image name
180  void* contextPtr
181  ///<
182 );
183 
184 //--------------------------------------------------------------------------------------------------
185 /**
186  * Add handler function for EVENT 'le_flash_BadImageDetection'
187  *
188  * This event provides information on bad image status.
189  *
190  */
191 //--------------------------------------------------------------------------------------------------
193 (
195  ///< [IN]
196  void* contextPtr
197  ///< [IN]
198 );
199 
200 //--------------------------------------------------------------------------------------------------
201 /**
202  * Remove handler function for EVENT 'le_flash_BadImageDetection'
203  */
204 //--------------------------------------------------------------------------------------------------
206 (
208  ///< [IN]
209 );
210 
211 #endif // LE_FLASH_INTERFACE_H_INCLUDE_GUARD
le_flash_BadImageDetectionHandlerRef_t le_flash_AddBadImageDetectionHandler(le_flash_BadImageDetectionHandlerFunc_t handlerPtr, void *contextPtr)
le_result_t
Definition: le_basics.h:35
void(* le_flash_BadImageDetectionHandlerFunc_t)(const char *LE_NONNULL imageName, void *contextPtr)
Definition: le_flash_interface.h:177
void(* le_flash_DisconnectHandler_t)(void *)
Definition: le_flash_interface.h:68
void le_flash_DisconnectService(void)
struct le_flash_BadImageDetectionHandler * le_flash_BadImageDetectionHandlerRef_t
Definition: le_flash_interface.h:166
void le_flash_SetServerDisconnectHandler(le_flash_DisconnectHandler_t disconnectHandler, void *contextPtr)
void le_flash_ConnectService(void)
void le_flash_RemoveBadImageDetectionHandler(le_flash_BadImageDetectionHandlerRef_t handlerRef)
le_result_t le_flash_TryConnectService(void)