le_avc_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_avc AirVantage Connector API
14  *
15  * @ref le_avc_interface.h "API Reference" <br>
16  * @ref legatoServicesAirVantage "AirVantage Connector Platform Service"
17  *
18  *
19  * The AirVantage connector service provides an API to communicate with the AirVantage Server to
20  * download and install updates.
21  *
22  * @section c_le_avc_update Firmware/Application Updates
23  *
24  * The API for firmware/application update is divided into two parts:
25  * - Allow an App to contact the server for pending updates. If available,
26  * can select to download or install the update.
27  * - Allow an App to block an update from being installed. An App may need this if it's
28  * performing a critical operation that can't be interrupted (e.g., eCall). This is necessary
29  * as installing an update will cause the App to restart (either the App itself needs to restart
30  * or a firmware change causes the modem to reset).
31  *
32  * @subsection c_le_avc_user_agreement User Agreement
33  *
34  * When writing a control app for the AirVantage Service it is up to the developer to ensure that
35  * user agreements have been enabled for all actions the control app performs. By default all
36  * user agreements are enabled except for LE_AVC_CONNECTION_PENDING and the avcService app will
37  * notify the control app and wait for a response before downloading or installing the update.
38  * If the avcService can't communicate with the control app it waits for 3 minutes and tries again.
39  * To not have the avcService wait for the control app to accept the agreement the user agreement
40  * must be disabled.
41  *
42  * There are 5 events that require user agreements:
43  * - LE_AVC_CONNECTION_PENDING
44  * - LE_AVC_DOWNLOAD_PENDING
45  * - LE_AVC_INSTALL_PENDING
46  * - LE_AVC_REBOOT_PENDING
47  * - LE_AVC_UNINSTALL_PENDING
48  *
49  * An app can respond to these user agreement notification by opening a connection if the
50  * notification is connection pending or by accepting or deferring the operation if the notification
51  * is one of download, install, uninstall or reboot pending.
52  *
53  * Whether avcService should forward these notifications to an app or act on these notifications by
54  * itself is determined by the individual configuration flags that enables or disables user
55  * agreement for these operations. If the user agreement flag is turned off for an operation,
56  * the default action by avcService is to automatically accept that pending operation. An app can
57  * register its handler by calling le_avc_AddStatusEventHandler() described in
58  * c_le_avc_update_control and the configuration flags can be set by le_avc_SetUserAgreement().
59  *
60  * Example of enabling user agreement for LE_AVC_DOWNLOAD_PENDING:
61  * @code
62  * le_result_t result;
63  * result = le_avc_SetUserAgreement(LE_AVC_USER_AGREEMENT_DOWNLOAD, true);
64  *
65  * if (result != LE_OK)
66  * {
67  * LE_ERROR("Failed to enable user agreement for download operation");
68  * }
69  * @endcode
70  *
71  * @subsection c_le_avc_update_control Update Control
72  *
73  * Any App can start a session with an AirVantage server to determine if there
74  * is a pending update. This is done with le_avc_StartSession().
75  *
76  * The current session can be stopped using le_avc_StopSession(). This cancels any query for pending
77  * update, or suspends a download in progress; however, it <b>won't stop</b> an install in progress.
78  *
79  * The status of a pending update is sent to all Apps registered for receiving a notification.
80  * An App can use le_avc_AddStatusEventHandler() to register a handler function to
81  * receive this notification. The notification will be received after a session is started.
82  *
83  * Example of registering an AVC handler and starting a session with fault checking:
84  * @code
85  * // Start AVC Session
86  * LE_INFO("AirVantage Connection Controller started.");
87  * le_avc_AddStatusEventHandler(avcStatusHandler, NULL); //register a AVC handler
88  *
89  * //Start AVC session. Note: AVC handler must be registered prior starting a session
90  * le_result_t result = le_avc_StartSession();
91  * if (LE_FAULT == result)
92  * {
93  * le_avc_StopSession();
94  * le_avc_StartSession();
95  * }
96  * @endcode
97  *
98  * An App can use le_avc_AddCommInfoHandler() to register a handler function and receive
99  * communication information notifications. This function returns a reference. To unregister
100  * the handler, le_avc_RemoveCommInfoHandler() should be called with the previously returned
101  * reference.
102  *
103  *
104  * Sometimes, @c avcService may decide to start a session with the AirVantage
105  * server; for instance if a call to le_avc_AcceptDownload() when the session is stopped,
106  * @c avcService will open a session to proceed with the download. In this case, a session started
107  * notification could also be received, even if le_avc_StartSession() is not called explicitly.
108  *
109  * @subsubsection c_le_avc_updateControl_pending Pending Updates
110  *
111  * There can only be one pending update at a time. To query the type of update, use
112  * le_avc_GetUpdateType(). App updates can call le_avc_GetAppUpdateName() to retrieve the App name.
113  *
114  * If a download is pending, le_avc_AcceptDownload() can be used to allow the update to be
115  * downloaded. An AirVantage session will be initiated if this api is called while there is no
116  * active AirVantage session. le_avc_DeferDownload() can be used to defer the download for the
117  * specified number of minutes. After the defer time has elapsed, the pending download notification
118  * will be re-sent again to all registered apps. le_avc_AcceptDownload() can be used to accept the
119  * download even before the defer timer expires. This behaviour is true for deferring install
120  * and uninstall as well.
121  *
122  * Once an update has been downloaded, a new notification will be received to indicate that an
123  * install is pending. Apps can then use le_avc_AcceptInstall() to allow the install to proceed.
124  *
125  * If an uninstall is pending, then le_avc_AcceptUninstall() can be used to allow the uninstall to
126  * proceed. To defer the decision, le_avc_DeferUninstall() can be used to defer the uninstall for
127  * the specified number of minutes. In case of an upgrade, the existing application will not be
128  * uninstalled after le_avc_AcceptUninstall() is called. le_avc_AcceptUninstall() is only used to
129  * signal the server to start downloading the new application. To proceed with an upgrade process,
130  * accept the uninstall of the existing version followed by accepting the download and install of
131  * the new version.
132  *
133  * @code
134  * switch (updateStatus)
135  * {
136  * case LE_AVC_DOWNLOAD_PENDING:
137  * LE_INFO("Accepting %s update.", GetUpdateType());
138  * res = le_avc_AcceptDownload();
139  * if (res != LE_OK)
140  * {
141  * LE_ERROR("Failed to accept download from AirVantage (%s)", LE_RESULT_TXT(res));
142  * }
143  * break;
144  *
145  * case LE_AVC_INSTALL_PENDING:
146  * LE_INFO("Accepting %s installation.", GetUpdateType());
147  * res = le_avc_AcceptInstall();
148  * if (res != LE_OK)
149  * {
150  * LE_ERROR("Failed to accept install from AirVantage (%s)", LE_RESULT_TXT(res));
151  * }
152  * break;
153  *
154  * case LE_AVC_UNINSTALL_PENDING:
155  * LE_INFO("Accepting %s uninstall.", GetUpdateType());
156  * res = le_avc_AcceptUninstall();
157  * if (res != LE_OK)
158  * {
159  * LE_ERROR("Failed to accept uninstall from AirVantage (%s)", LE_RESULT_TXT(res));
160  * }
161  * break;
162  *
163  * case LE_AVC_REBOOT_PENDING:
164  * LE_INFO("Accepting device reboot.");
165  * res = le_avc_AcceptReboot();
166  * if (res != LE_OK)
167  * {
168  * LE_ERROR("Failed to accept reboot from AirVantage (%s)", LE_RESULT_TXT(res));
169  * }
170  * break;
171  *
172  * default:
173  * // No action required
174  * break;
175  * }
176  * @endcode
177  *
178  * @note Even if an App calls le_avc_AcceptInstall(), the install may still be blocked by another
179  * App using the @ref c_le_avc_update_app functions. To defer the decision, an App can use
180  * le_avc_DeferInstall() to defer the install for the specified number of minutes. After the defer
181  * time has elapsed, the pending install notification will be re-sent to allow Apps to make a new
182  * decision, or again defer.
183  *
184  *
185  * @subsubsection c_le_avc_updateControl_accepting Accepting Installs/Uninstalls
186  *
187  * Accepting an App install or uninstall will not initiate an AirVantage session if no session
188  * is active. An App should start an AirVantage session before accepting an App install/uninstall,
189  * to ensure the process is completed, and the server is updated.
190  *
191  * If no app has registered for notifications using le_avc_AddStatusEventHandler(),
192  * then any pending downloads and installs will happen automatically, subject to any restrictions
193  * imposed by app using the @ref c_le_avc_update_app functions.
194  *
195  * There is no restriction on the number of Apps registering for notifications.
196  *
197  * In case of any error incurred during App download/install, an error code will be set which can be
198  * retrieved by calling le_avc_GetErrorCode().
199  *
200  * @subsection c_le_avc_update_app Application Installation Blocking
201  *
202  * When an App is about to perform a critical operation, it can block the installation of
203  * an update with le_avc_BlockInstall(), and after it's finished with the critical operation, it
204  * can unblock the install with le_avc_UnblockInstall().
205  *
206  * What constitutes a critical operation depends on the App. An eCall App might
207  * block installs for the duration that it runs. A data collection App that wakes up
208  * once an hour might block installs while it collects and stores and/or transmits a new data
209  * sample, and then unblock installs just before it goes to sleep again.
210  *
211  * If an install can't be applied because it's blocked, another attempt to apply the install
212  * will be made at a later time.
213  *
214  * An App can add a session control handler using le_avc_AddSessionRequestEventHandler(). Requests
215  * by user Apps to open or close session will be forwarded to the session control handler. If no App
216  * has registered a session request handler, AVC session can be opened or closed anytime by
217  * user Apps.
218  *
219  * @subsection c_le_avc_suspend_resume Suspend and resume an update
220  *
221  * A firmware/application update can be interrupted or suspended by different events:
222  * - a device reboot
223  * - a network loss
224  * - a manual suspend through a session stop.
225  *
226  * After the update suspension, when the @c avcService is ready to resume the update process:
227  * - If the user agreements are disabled, the update process is automatically restarted.
228  * - If the user agreements are enabled, the previous @c PENDING notification is sent to the App,
229  * as indicated in the table below.
230  *
231  * @note The @c avcService might take a while to suspend the update process (typically a few
232  * minutes), e.g. in some cases of firmware update. The @c PENDING notification will therefore be
233  * sent only when the suspension is over. Trying to resume the update process while the suspension
234  * is not over and the notification is not received has no effect.
235  *
236  * | Last received event | Event sent to resume | Expected action from App |
237  * |--------------------------------|-------------------------------------------------------------|--------------------------|
238  * | @c LE_AVC_DOWNLOAD_PENDING | @c LE_AVC_DOWNLOAD_PENDING | Accept download |
239  * | @c LE_AVC_DOWNLOAD_IN_PROGRESS | @c LE_AVC_DOWNLOAD_PENDING with remaining bytes to download | Accept download |
240  * | @c LE_AVC_DOWNLOAD_COMPLETE | @c LE_AVC_DOWNLOAD_PENDING with zero bytes to download | Accept download |
241  * | @c LE_AVC_INSTALL_PENDING | @c LE_AVC_INSTALL_PENDING | Accept install |
242  * | @c LE_AVC_INSTALL_IN_PROGRESS | @c LE_AVC_INSTALL_PENDING | Accept install |
243  * | @c LE_AVC_UNINSTALL_PENDING | @c LE_AVC_UNINSTALL_PENDING | Accept uninstall |
244  * | @c LE_AVC_CONNECTION_PENDING | @c LE_AVC_CONNECTION_PENDING | Start session |
245  *
246  * @note If firmware is updated (via fwupdate tool) or new legato is installed (via instlegato),
247  * all suspend/resume information stored by avcService is erased. So if developer updates firmware
248  * or legato (via ethernet or ecm etc.) in the middle of any update initiated by avcService, this
249  * need to be cancelled and restarted again from airVantage server.
250  *
251  * @section c_le_avc_Timers Timers
252  *
253  * Polling timers sets the time that the Target will communicate with the AirVantage Server to check
254  * for new jobs. Retry timers will try and re-establish a connection to the AirVantage Server in
255  * accordance with the times that are declared.
256  *
257  * @subsection c_le_avc_PollingTimer Polling Timer
258  *
259  * The target will periodically initiate a connection to the AirVantage Server according to the
260  * settings for the polling timer to check if there are any pending jobs. The polling timer will
261  * initiate a session when it starts the count (at 0 minutes) and then again at the specified time
262  * set.
263  *
264  * To disable the polling timer call le_avc_SetPollingTimer() and set the value to 0.
265  *
266  * The polling timer accepts ranges from 0 to 525600 minutes. The polling timer does not get reset
267  * with reboots or power loss. If the target is powered off during the polling time, it will
268  * connect to the AVC Server upon startup of the app. For example, if the polling timer is set to 1
269  * hour then and the target reboots at the 20 minute mark, the polling timer will still initiate a
270  * connection at the 1 hour mark. If the target is powered off or in the middle of rebooting at the
271  * 1 hour mark, as soon as the app is started again, the polling timer will initiate a connection to
272  * the AirVantage Server.
273  *
274  * Polling timer initiated sessions will be disconnected after 20 seconds of inactivity. This does
275  * not apply to AirVantage sessions that have been initiated by an app. The app is responsible for
276  * disconnecting the session it initiates within a reasonable timeframe. Leaving the session open
277  * for long period will result in power wastage.
278  *
279  * To read the polling timer call: le_avc_GetPollingTimer()
280  *
281  * To write a new value to the polling timer call: le_avc_SetPollingTimer()
282  *
283  * Writing to the polling timer stops the current polling timer if it is running and starts a timer
284  * with the new value. The next connection will be initiated when the new polling timer reaches it's
285  * set value.
286  *
287  * @subsection c_le_avc_RetryTimers Retry Timers
288  *
289  * If an error occurs during a connection to the Device Services server (WWAN DATA establishment
290  * failed and an http error code is received) the embedded module will initiate a new connection
291  * according to the values defined in the retry timers.
292  *
293  * The timers are tried in sequence until a connection is established, or all enabled retry timers
294  * are exhausted. After all the enabled timers are exhausted, a new session must be initiated again
295  * by calling le_avc_startSession() after the expiry of the retry timer.
296  *
297  * The retry timer values are persistent (reboots and updates do not effect the retry timers).
298  * If you wish to disable a retry timer set the timer value
299  * to 0. You must always pass in at least 8 values to the retry timers.
300  *
301  * Retry timer values range from 0 to 20160 minutes.
302  * The function le_avc_GetRetryTimers() reads the retry timers in an array and the function
303  * le_avc_SetRetryTimers() writes the retry timers. When writing to the retry timers, values of
304  * all the 8 timers have to be defined.
305  *
306  * Example of calling retry timers, the session will be retried after 15 minutes, 1 hour, 4 hours,
307  * 8 hours, 1 day and 2 days, the last two retries are disabled:
308  * @code
309  * uint16_t RetryTimers[LE_AVC_NUM_RETRY_TIMERS] = {15, 60, 240, 480, 1440, 2880, 0, 0};
310  * le_avc_SetRetryTimers(RetryTimers, LE_AVC_NUM_RETRY_TIMERS);
311  * @endcode
312  *
313  * @section c_le_avc_reboot Device reboot
314  *
315  * The AirVantage server can request to reboot the device. If a reboot is requested a notification
316  * is sent to the registered Apps. The App can either accept the reboot with le_avc_AcceptReboot()
317  * or defer it for a specified number of minutes with le_avc_DeferReboot(). After the defer time
318  * has elapsed, the pending reboot notification will be re-sent. This allows the registered app to
319  * make a new decision or defer the reboot again.
320  *
321  * If no App has registered for notifications using le_avc_AddStatusEventHandler(), then
322  * any pending reboot will happen automatically.
323  *
324  * @section c_le_avc_GetCredentialStatus Credential Status
325  * The device is provisioned with bootstrap credentials from factory. The Device Management (DM)
326  * credentials are provisioned by AirVantage Bootstrap Server. This API is used to retrieve the
327  * status of credentials provisioned on the device.
328  *
329  * @section c_le_avc_connection Connection pending
330  *
331  * The AirVantage agent can request a connection to the AirVantage server, especially when a
332  * firmware package is installed (after a platform reboot) or device reboots in the middle of
333  * software update (after finishing software update on reboot). In this case a notification is sent
334  * to the control App, which can start the connection with le_avc_StartSession().
335  *
336  * @section c_le_avc_routing Data routing
337  *
338  * By default the AirVantage connection uses the default mobile data profile and the default route
339  * set by the data connection service.
340  *
341  * If the user wishes to control the network configuration, e.g. to use the AirVantage agent with
342  * multi-PDP contexts, they should first bind the application to the data connection service:
343  * @verbatim
344  bindings:
345  {
346  clientExe.clientComponent.le_data -> dataConnectionService.le_data
347  }
348  @endverbatim
349  *
350  * The data connection service should then be configured before launching the AirVantage connection:
351  * - le_data_SetCellularProfileIndex() allows to change the data profile to use.
352  * - le_data_GetDefaultRouteStatus() indicates if the default route is activated in the data
353  * connection service. This default route can be deactivated in the data connection service
354  * configuration database, as explained in @ref c_le_data_defaultRoute. If the default route is
355  * deactivated, the AirVantage agent will automatically add routes to be able to reach the
356  * AirVantage server through the connection used by AirVantage.
357  *
358  * @section c_le_avc_timeout Connection / Download timeout
359  *
360  * The AirVantage connector service will abort FOTA/SOTA download, if it takes more than
361  * 300 seconds to establish a connection. Download will also be aborted, if the download speed is
362  * too low (less than 100 bytes /second) for too long (for more than 1000 seconds).
363  * These values are chosen based on experiments on low speed network. There is no configuration
364  * for these timeouts.
365  *
366  * @section le_avcService_configdb Service Configuration Tree
367  * @copydoc le_avcService_configdbPage_Hide
368  *
369  *
370  * Copyright (C) Sierra Wireless Inc.
371  */
372 /**
373  * @interface le_avcService_configdbPage_Hide
374  *
375  * The configuration database path for the activityTimeout is:
376  * @verbatim
377  /
378  apps/
379  avcService/
380  activityTimeout
381  @endverbatim
382  *
383  *
384  * After an AirVantage session is started, if there's no activity between the device and the server
385  * within the timer interval, then LE_AVC_NO_UPDATE state will be returned to the app. However,
386  * this activity timeout can be overridden by setting an integer value for
387  * /apps/avcService/activityTimeout. The activity timer is initialized only when the @c avcService
388  * starts. If a valid entry >0 is found, then it will be used instead of the default value of 20
389  * seconds. The following steps should be used to set the activityTimeout.
390  *
391  *
392  * @verbatim
393  config set /apps/avcService/activityTimeout xx int
394  app restart avcService
395  @endverbatim
396  *
397  * @note
398  * Everytime a new value is written to activityTimeout, the avcService needs to be
399  * restarted to read the new value.
400  *
401  *
402  */
403 /**
404  * @file le_avc_interface.h
405  *
406  * Legato @ref c_le_avc include file.
407  *
408  * Copyright (C) Sierra Wireless Inc.
409  */
410 
411 #ifndef LE_AVC_INTERFACE_H_INCLUDE_GUARD
412 #define LE_AVC_INTERFACE_H_INCLUDE_GUARD
413 
414 
415 #include "legato.h"
416 
417 // Interface specific includes
418 #include "le_limit_interface.h"
419 
420 
421 //--------------------------------------------------------------------------------------------------
422 /**
423  * Type for handler called when a server disconnects.
424  */
425 //--------------------------------------------------------------------------------------------------
426 typedef void (*le_avc_DisconnectHandler_t)(void *);
427 
428 //--------------------------------------------------------------------------------------------------
429 /**
430  *
431  * Connect the current client thread to the service providing this API. Block until the service is
432  * available.
433  *
434  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
435  * called before any other functions in this API. Normally, ConnectService is automatically called
436  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
437  *
438  * This function is created automatically.
439  */
440 //--------------------------------------------------------------------------------------------------
442 (
443  void
444 );
445 
446 //--------------------------------------------------------------------------------------------------
447 /**
448  *
449  * Try to connect the current client thread to the service providing this API. Return with an error
450  * if the service is not available.
451  *
452  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
453  * called before any other functions in this API. Normally, ConnectService is automatically called
454  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
455  *
456  * This function is created automatically.
457  *
458  * @return
459  * - LE_OK if the client connected successfully to the service.
460  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
461  * bound.
462  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
463  * - LE_COMM_ERROR if the Service Directory cannot be reached.
464  */
465 //--------------------------------------------------------------------------------------------------
467 (
468  void
469 );
470 
471 //--------------------------------------------------------------------------------------------------
472 /**
473  * Set handler called when server disconnection is detected.
474  *
475  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
476  * to continue without exiting, it should call longjmp() from inside the handler.
477  */
478 //--------------------------------------------------------------------------------------------------
480 (
481  le_avc_DisconnectHandler_t disconnectHandler,
482  void *contextPtr
483 );
484 
485 //--------------------------------------------------------------------------------------------------
486 /**
487  *
488  * Disconnect the current client thread from the service providing this API.
489  *
490  * Normally, this function doesn't need to be called. After this function is called, there's no
491  * longer a connection to the service, and the functions in this API can't be used. For details, see
492  * @ref apiFilesC_client.
493  *
494  * This function is created automatically.
495  */
496 //--------------------------------------------------------------------------------------------------
498 (
499  void
500 );
501 
502 
503 //--------------------------------------------------------------------------------------------------
504 /**
505  * Maximum APN name length without NULL terminator.
506  */
507 //--------------------------------------------------------------------------------------------------
508 #define LE_AVC_APN_NAME_MAX_LEN 48
509 
510 //--------------------------------------------------------------------------------------------------
511 /**
512  * Maximum APN name length including NULL terminator.
513  */
514 //--------------------------------------------------------------------------------------------------
515 #define LE_AVC_APN_NAME_MAX_LEN_BYTES 49
516 
517 //--------------------------------------------------------------------------------------------------
518 /**
519  * Maximum user name length without NULL terminator.
520  */
521 //--------------------------------------------------------------------------------------------------
522 #define LE_AVC_USERNAME_MAX_LEN 28
523 
524 //--------------------------------------------------------------------------------------------------
525 /**
526  * Maximum user name length including NULL terminator.
527  */
528 //--------------------------------------------------------------------------------------------------
529 #define LE_AVC_USERNAME_MAX_LEN_BYTES 29
530 
531 //--------------------------------------------------------------------------------------------------
532 /**
533  * Maximum password length without NULL terminator..
534  */
535 //--------------------------------------------------------------------------------------------------
536 #define LE_AVC_PASSWORD_MAX_LEN 28
537 
538 //--------------------------------------------------------------------------------------------------
539 /**
540  * Maximum password length including NULL terminator.
541  */
542 //--------------------------------------------------------------------------------------------------
543 #define LE_AVC_PASSWORD_MAX_LEN_BYTES 29
544 
545 //--------------------------------------------------------------------------------------------------
546 /**
547  * Maximum number of retry timers.
548  */
549 //--------------------------------------------------------------------------------------------------
550 #define LE_AVC_NUM_RETRY_TIMERS 8
551 
552 //--------------------------------------------------------------------------------------------------
553 /**
554  * Polling timer value range in minutes. 525600 minutes = 1 year.
555  */
556 //--------------------------------------------------------------------------------------------------
557 #define LE_AVC_POLLING_TIMER_MAX_VAL 525600
558 
559 //--------------------------------------------------------------------------------------------------
560 /**
561  */
562 //--------------------------------------------------------------------------------------------------
563 #define LE_AVC_POLLING_TIMER_MIN_VAL 0
564 
565 //--------------------------------------------------------------------------------------------------
566 /**
567  * Retry timer value range in minutes. 20160 minutes = 2 weeks.
568  */
569 //--------------------------------------------------------------------------------------------------
570 #define LE_AVC_RETRY_TIMER_MAX_VAL 20160
571 
572 //--------------------------------------------------------------------------------------------------
573 /**
574  */
575 //--------------------------------------------------------------------------------------------------
576 #define LE_AVC_RETRY_TIMER_MIN_VAL 0
577 
578 //--------------------------------------------------------------------------------------------------
579 /**
580  * Default HTTP status.
581  */
582 //--------------------------------------------------------------------------------------------------
583 #define LE_AVC_HTTP_STATUS_INVALID 65535
584 
585 //--------------------------------------------------------------------------------------------------
586 /**
587  * Communication info max string size
588  */
589 //--------------------------------------------------------------------------------------------------
590 #define LE_AVC_COMM_INFO_STR_MAX_LEN 256
591 
592 //--------------------------------------------------------------------------------------------------
593 /**
594  * Communication info codes
595  */
596 //--------------------------------------------------------------------------------------------------
597 #define LE_AVC_COMM_INFO_UDP_NO_ERR 0
598 
599 //--------------------------------------------------------------------------------------------------
600 /**
601  */
602 //--------------------------------------------------------------------------------------------------
603 #define LE_AVC_COMM_INFO_UDP_OPEN_ERR 1
604 
605 //--------------------------------------------------------------------------------------------------
606 /**
607  */
608 //--------------------------------------------------------------------------------------------------
609 #define LE_AVC_COMM_INFO_UDP_CLOSE_ERR 2
610 
611 //--------------------------------------------------------------------------------------------------
612 /**
613  */
614 //--------------------------------------------------------------------------------------------------
615 #define LE_AVC_COMM_INFO_UDP_SEND_ERR 3
616 
617 //--------------------------------------------------------------------------------------------------
618 /**
619  */
620 //--------------------------------------------------------------------------------------------------
621 #define LE_AVC_COMM_INFO_UDP_RECV_ERR 4
622 
623 //--------------------------------------------------------------------------------------------------
624 /**
625  */
626 //--------------------------------------------------------------------------------------------------
627 #define LE_AVC_COMM_INFO_UDP_CONNECT_ERR 5
628 
629 //--------------------------------------------------------------------------------------------------
630 /**
631  */
632 //--------------------------------------------------------------------------------------------------
633 #define LE_AVC_COMM_INFO_BEARER_UP 6
634 
635 //--------------------------------------------------------------------------------------------------
636 /**
637  */
638 //--------------------------------------------------------------------------------------------------
639 #define LE_AVC_COMM_INFO_BEARER_DOWN 7
640 
641 //--------------------------------------------------------------------------------------------------
642 /**
643  */
644 //--------------------------------------------------------------------------------------------------
645 #define LE_AVC_COMM_INFO_PDP_CONTEXT 8
646 
647 //--------------------------------------------------------------------------------------------------
648 /**
649  */
650 //--------------------------------------------------------------------------------------------------
651 #define LE_AVC_COMM_INFO_COAP_201_CREATED 65
652 
653 //--------------------------------------------------------------------------------------------------
654 /**
655  */
656 //--------------------------------------------------------------------------------------------------
657 #define LE_AVC_COMM_INFO_COAP_202_DELETED 66
658 
659 //--------------------------------------------------------------------------------------------------
660 /**
661  */
662 //--------------------------------------------------------------------------------------------------
663 #define LE_AVC_COMM_INFO_COAP_204_CHANGED 68
664 
665 //--------------------------------------------------------------------------------------------------
666 /**
667  */
668 //--------------------------------------------------------------------------------------------------
669 #define LE_AVC_COMM_INFO_COAP_205_CONTENT 69
670 
671 //--------------------------------------------------------------------------------------------------
672 /**
673  */
674 //--------------------------------------------------------------------------------------------------
675 #define LE_AVC_COMM_INFO_COAP_231_CONTINUE 95
676 
677 //--------------------------------------------------------------------------------------------------
678 /**
679  */
680 //--------------------------------------------------------------------------------------------------
681 #define LE_AVC_COMM_INFO_COAP_400_BAD_REQUEST 128
682 
683 //--------------------------------------------------------------------------------------------------
684 /**
685  */
686 //--------------------------------------------------------------------------------------------------
687 #define LE_AVC_COMM_INFO_COAP_401_UNAUTHORIZED 129
688 
689 //--------------------------------------------------------------------------------------------------
690 /**
691  */
692 //--------------------------------------------------------------------------------------------------
693 #define LE_AVC_COMM_INFO_COAP_402_BAD_OPTION 130
694 
695 //--------------------------------------------------------------------------------------------------
696 /**
697  */
698 //--------------------------------------------------------------------------------------------------
699 #define LE_AVC_COMM_INFO_COAP_404_NOT_FOUND 132
700 
701 //--------------------------------------------------------------------------------------------------
702 /**
703  */
704 //--------------------------------------------------------------------------------------------------
705 #define LE_AVC_COMM_INFO_COAP_405_METHOD_NOT_ALLOWED 133
706 
707 //--------------------------------------------------------------------------------------------------
708 /**
709  */
710 //--------------------------------------------------------------------------------------------------
711 #define LE_AVC_COMM_INFO_COAP_406_NOT_ACCEPTABLE 134
712 
713 //--------------------------------------------------------------------------------------------------
714 /**
715  */
716 //--------------------------------------------------------------------------------------------------
717 #define LE_AVC_COMM_INFO_COAP_408_REQ_ENTITY_INCOMPLETE 136
718 
719 //--------------------------------------------------------------------------------------------------
720 /**
721  */
722 //--------------------------------------------------------------------------------------------------
723 #define LE_AVC_COMM_INFO_COAP_412_PRECONDITION_FAILED 140
724 
725 //--------------------------------------------------------------------------------------------------
726 /**
727  */
728 //--------------------------------------------------------------------------------------------------
729 #define LE_AVC_COMM_INFO_COAP_413_ENTITY_TOO_LARGE 141
730 
731 //--------------------------------------------------------------------------------------------------
732 /**
733  */
734 //--------------------------------------------------------------------------------------------------
735 #define LE_AVC_COMM_INFO_COAP_500_INTERNAL_SERVER_ERROR 160
736 
737 //--------------------------------------------------------------------------------------------------
738 /**
739  */
740 //--------------------------------------------------------------------------------------------------
741 #define LE_AVC_COMM_INFO_COAP_501_NOT_IMPLEMENTED 161
742 
743 //--------------------------------------------------------------------------------------------------
744 /**
745  */
746 //--------------------------------------------------------------------------------------------------
747 #define LE_AVC_COMM_INFO_COAP_503_SERVICE_UNAVAILABLE 163
748 
749 //--------------------------------------------------------------------------------------------------
750 /**
751  * Status of session or update
752  *
753  * If an update is pending, it must first be downloaded and then installed.
754  */
755 //--------------------------------------------------------------------------------------------------
756 typedef enum
757 {
759  ///< No updates pending
761  ///< Update pending download
763  ///< Download in progress
765  ///< Download has completed
767  ///< An error occurred downloading the update
769  ///< Install is pending (implies download complete)
771  ///< Install in progress
773  ///< Update has been successfully installed
775  ///< An error occurred installing the update
777  ///< Uninstall is pending
779  ///< Uninstall in progress
781  ///< App has been successfully uninstalled
783  ///< An error occurred uninstalling the update
785  ///< Session with AirVantage device management server started
787  ///< Session with bootstrap server started
789  ///< Session with AirVantage device management server or bootstrap
790  ///< server stopped
792  ///< Session with AirVantage device management server or bootstrap
793  ///< server failed
795  ///< Device reboot is pending
797  ///< Connection to the server is required. This is necessary when
798  ///< firmware package is installed (after a platform reboot). Also
799  ///< necessary after software update if device reboots(or session stops)
800  ///< in the middle of software update.
802  ///< Authentication with AirVantage device management server or
803  ///< bootstrap server started
805  ///< Authentication with AirVantage device management server or
806  ///< bootstrap server failed
808  ///< Package is certified sent by a trusted server
810  ///< Package is not certified sent by a trusted server
811 }
813 
814 
815 //--------------------------------------------------------------------------------------------------
816 /**
817  * Operations which require user agreement
818  */
819 //--------------------------------------------------------------------------------------------------
820 typedef enum
821 {
823  ///< User agreement for connection
825  ///< User agreement for download
827  ///< User agreement for install
829  ///< User agreement for uninstall
831  ///< User agreement for reboot
832 }
834 
835 
836 //--------------------------------------------------------------------------------------------------
837 /**
838  * Request to open or close avms session.
839  */
840 //--------------------------------------------------------------------------------------------------
841 typedef enum
842 {
844  ///< Request by user app to open AV session
846  ///< Request by user app to close AV session
847 }
849 
850 
851 //--------------------------------------------------------------------------------------------------
852 /**
853  * The type of pending update
854  */
855 //--------------------------------------------------------------------------------------------------
856 typedef enum
857 {
858  LE_AVC_UNKNOWN_UPDATE = 0,
859  ///<
860  LE_AVC_FIRMWARE_UPDATE = 1,
861  ///<
862  LE_AVC_FRAMEWORK_UPDATE = 2,
863  ///<
864  LE_AVC_APPLICATION_UPDATE = 3
865  ///<
866 }
868 
869 
870 //--------------------------------------------------------------------------------------------------
871 /**
872  * Error code used to provide diagnostic information after a failure (includes both download and
873  * install failure).
874  *
875  * @note
876  * Additional information may also be available in the target device's system log.
877  */
878 //--------------------------------------------------------------------------------------------------
879 typedef enum
880 {
882  ///< No error.
884  ///< Encountered a bad package.
886  ///< Something failed while doing install/download.
888  ///< Security check failure while installing the package.
889 }
891 
892 
893 //--------------------------------------------------------------------------------------------------
894 /**
895  * Session type indicates whether the device is connected to the bootstrap server or the
896  * device management server.
897  */
898 //--------------------------------------------------------------------------------------------------
899 typedef enum
900 {
902  ///< Bootstrap session.
904  ///< Device Management session.
906  ///< Session type invalid.
907 }
909 
910 
911 //--------------------------------------------------------------------------------------------------
912 /**
913  * Status of the device credentials
914  */
915 //--------------------------------------------------------------------------------------------------
916 typedef enum
917 {
919  ///< Neither Bootstrap nor Device Management
920  ///< credential is provisioned.
922  ///< Bootstrap credential is provisioned but Device
923  ///< Management credential is not provisioned.
925  ///< Device Management credential is provisioned.
926 }
928 
929 
930 //--------------------------------------------------------------------------------------------------
931 /**
932  * Reference type used by Add/Remove functions for EVENT 'le_avc_StatusEvent'
933  */
934 //--------------------------------------------------------------------------------------------------
935 typedef struct le_avc_StatusEventHandler* le_avc_StatusEventHandlerRef_t;
936 
937 
938 //--------------------------------------------------------------------------------------------------
939 /**
940  * Reference type used by Add/Remove functions for EVENT 'le_avc_SessionRequestEvent'
941  */
942 //--------------------------------------------------------------------------------------------------
943 typedef struct le_avc_SessionRequestEventHandler* le_avc_SessionRequestEventHandlerRef_t;
944 
945 
946 //--------------------------------------------------------------------------------------------------
947 /**
948  * Reference type used by Add/Remove functions for EVENT 'le_avc_CommInfo'
949  */
950 //--------------------------------------------------------------------------------------------------
951 typedef struct le_avc_CommInfoHandler* le_avc_CommInfoHandlerRef_t;
952 
953 
954 //--------------------------------------------------------------------------------------------------
955 /**
956  * Reference returned by BlockInstall function and used by UnblockInstall function
957  */
958 //--------------------------------------------------------------------------------------------------
959 typedef struct le_avc_BlockRequest* le_avc_BlockRequestRef_t;
960 
961 
962 //--------------------------------------------------------------------------------------------------
963 /**
964  * Handler for update availability status
965  */
966 //--------------------------------------------------------------------------------------------------
967 typedef void (*le_avc_StatusHandlerFunc_t)
968 (
969  le_avc_Status_t updateStatus,
970  ///< status of pending update, if available
971  int32_t totalNumBytes,
972  ///< Total number of bytes to be downloaded
973  ///< only valid when updateStatus is one of
974  ///< DOWNLOAD_PENDING, DOWNLOAD_IN_PROGRESS or DOWNLOAD_COMPLETE.
975  ///< returns -1 if value is unknown
976  int32_t progress,
977  ///< Task completion in percentage
978  ///< Valid when updateStatus is one of DOWNLOAD_IN_PROGRESS,
979  ///< INSTALL_IN_PROGRESS or UNINSTALL_IN_PROGRESS.
980  ///< returns -1 if value is unknown
981  void* contextPtr
982  ///<
983 );
984 
985 //--------------------------------------------------------------------------------------------------
986 /**
987  * Handler for receiving session open or close request.
988  */
989 //--------------------------------------------------------------------------------------------------
991 (
992  le_avc_SessionRequest_t request,
993  ///< Request to open or close AV session
994  void* contextPtr
995  ///<
996 );
997 
998 //--------------------------------------------------------------------------------------------------
999 /**
1000  * Handler for receiving communication information.
1001  */
1002 //--------------------------------------------------------------------------------------------------
1003 typedef void (*le_avc_CommInfoHandlerFunc_t)
1005  uint8_t code,
1006  ///< Communication information code
1007  const char* LE_NONNULL str,
1008  ///< Communication information string
1009  void* contextPtr
1010  ///<
1011 );
1012 
1013 //--------------------------------------------------------------------------------------------------
1014 /**
1015  * Add handler function for EVENT 'le_avc_StatusEvent'
1016  *
1017  * This event provides information on update availability status
1018  */
1019 //--------------------------------------------------------------------------------------------------
1021 (
1022  le_avc_StatusHandlerFunc_t handlerPtr,
1023  ///< [IN]
1024  void* contextPtr
1025  ///< [IN]
1026 );
1027 
1028 //--------------------------------------------------------------------------------------------------
1029 /**
1030  * Remove handler function for EVENT 'le_avc_StatusEvent'
1031  */
1032 //--------------------------------------------------------------------------------------------------
1034 (
1036  ///< [IN]
1037 );
1038 
1039 //--------------------------------------------------------------------------------------------------
1040 /**
1041  * Add handler function for EVENT 'le_avc_SessionRequestEvent'
1042  *
1043  * This event provides information on session open or close request.
1044  */
1045 //--------------------------------------------------------------------------------------------------
1047 (
1049  ///< [IN]
1050  void* contextPtr
1051  ///< [IN]
1052 );
1053 
1054 //--------------------------------------------------------------------------------------------------
1055 /**
1056  * Remove handler function for EVENT 'le_avc_SessionRequestEvent'
1057  */
1058 //--------------------------------------------------------------------------------------------------
1060 (
1062  ///< [IN]
1063 );
1064 
1065 //--------------------------------------------------------------------------------------------------
1066 /**
1067  * Add handler function for EVENT 'le_avc_CommInfo'
1068  *
1069  * This event provides communication errors.
1070  */
1071 //--------------------------------------------------------------------------------------------------
1073 (
1074  le_avc_CommInfoHandlerFunc_t handlerPtr,
1075  ///< [IN]
1076  void* contextPtr
1077  ///< [IN]
1078 );
1079 
1080 //--------------------------------------------------------------------------------------------------
1081 /**
1082  * Remove handler function for EVENT 'le_avc_CommInfo'
1083  */
1084 //--------------------------------------------------------------------------------------------------
1086 (
1087  le_avc_CommInfoHandlerRef_t handlerRef
1088  ///< [IN]
1089 );
1090 
1091 //--------------------------------------------------------------------------------------------------
1092 /**
1093  * Start a session with the AirVantage server
1094  *
1095  * This will cause a query to be sent to the server, for pending updates.
1096  *
1097  * @return
1098  * - LE_OK if connection request has been sent.
1099  * - LE_FAULT on failure
1100  * - LE_DUPLICATE if already connected.
1101  */
1102 //--------------------------------------------------------------------------------------------------
1104 (
1105  void
1106 );
1107 
1108 //--------------------------------------------------------------------------------------------------
1109 /**
1110  * Stop a session with the AirVantage server
1111  *
1112  * If a download is in progress, then this suspends the download.
1113  *
1114  * @return
1115  * - LE_OK on success
1116  * - LE_FAULT on failure
1117  */
1118 //--------------------------------------------------------------------------------------------------
1120 (
1121  void
1122 );
1123 
1124 //--------------------------------------------------------------------------------------------------
1125 /**
1126  * Send a specific message to the server to be sure that the route between the device and the server
1127  * is available.
1128  * This API needs to be called when any package download is over (successfully or not) and before
1129  * sending any notification on asset data to the server.
1130  *
1131  * @return
1132  * - LE_OK when the treatment is launched
1133  * - LE_FAULT on failure
1134  * - LE_UNSUPPORTED when the API is not supported
1135  *
1136  */
1137 //--------------------------------------------------------------------------------------------------
1139 (
1140  void
1141 );
1142 
1143 //--------------------------------------------------------------------------------------------------
1144 /**
1145  * Defer the currently pending connection, for the given number of minutes
1146  *
1147  * @return
1148  * - LE_OK on success
1149  * - LE_FAULT on failure
1150  */
1151 //--------------------------------------------------------------------------------------------------
1153 (
1154  uint32_t deferMinutes
1155  ///< [IN]
1156 );
1157 
1158 //--------------------------------------------------------------------------------------------------
1159 /**
1160  * Accept the currently pending download
1161  *
1162  * @return
1163  * - LE_OK on success
1164  * - LE_FAULT on failure
1165  */
1166 //--------------------------------------------------------------------------------------------------
1168 (
1169  void
1170 );
1171 
1172 //--------------------------------------------------------------------------------------------------
1173 /**
1174  * Defer the currently pending download, for the given number of minutes
1175  *
1176  * @return
1177  * - LE_OK on success
1178  * - LE_FAULT on failure
1179  */
1180 //--------------------------------------------------------------------------------------------------
1182 (
1183  uint32_t deferMinutes
1184  ///< [IN]
1185 );
1186 
1187 //--------------------------------------------------------------------------------------------------
1188 /**
1189  * Accept the currently pending install
1190  *
1191  * @return
1192  * - LE_OK on success
1193  * - LE_FAULT on failure
1194  */
1195 //--------------------------------------------------------------------------------------------------
1197 (
1198  void
1199 );
1200 
1201 //--------------------------------------------------------------------------------------------------
1202 /**
1203  * Defer the currently pending install
1204  *
1205  * @return
1206  * - LE_OK on success
1207  * - LE_FAULT on failure
1208  */
1209 //--------------------------------------------------------------------------------------------------
1211 (
1212  uint32_t deferMinutes
1213  ///< [IN]
1214 );
1215 
1216 //--------------------------------------------------------------------------------------------------
1217 /**
1218  * Accept the currently pending uninstall
1219  *
1220  * @return
1221  * - LE_OK on success
1222  * - LE_FAULT on failure
1223  */
1224 //--------------------------------------------------------------------------------------------------
1226 (
1227  void
1228 );
1229 
1230 //--------------------------------------------------------------------------------------------------
1231 /**
1232  * Defer the currently pending uninstall
1233  *
1234  * @return
1235  * - LE_OK on success
1236  * - LE_FAULT on failure
1237  */
1238 //--------------------------------------------------------------------------------------------------
1240 (
1241  uint32_t deferMinutes
1242  ///< [IN]
1243 );
1244 
1245 //--------------------------------------------------------------------------------------------------
1246 /**
1247  * Accept the currently pending reboot
1248  *
1249  * @return
1250  * - LE_OK on success
1251  * - LE_FAULT on failure
1252  */
1253 //--------------------------------------------------------------------------------------------------
1255 (
1256  void
1257 );
1258 
1259 //--------------------------------------------------------------------------------------------------
1260 /**
1261  * Defer the currently pending reboot
1262  *
1263  * @return
1264  * - LE_OK on success
1265  * - LE_FAULT on failure
1266  */
1267 //--------------------------------------------------------------------------------------------------
1269 (
1270  uint32_t deferMinutes
1271  ///< [IN]
1272 );
1273 
1274 //--------------------------------------------------------------------------------------------------
1275 /**
1276  * Get the update type of the currently pending update
1277  *
1278  * @return
1279  * - LE_OK on success
1280  * - LE_FAULT if not available
1281  */
1282 //--------------------------------------------------------------------------------------------------
1284 (
1285  le_avc_UpdateType_t* updateTypePtr
1286  ///< [OUT]
1287 );
1288 
1289 //--------------------------------------------------------------------------------------------------
1290 /**
1291  * Get the name for the currently pending app update
1292  *
1293  * @return
1294  * - LE_OK on success
1295  * - LE_FAULT if not available, or isn't APPL_UPDATE type
1296  */
1297 //--------------------------------------------------------------------------------------------------
1299 (
1300  char* updateName,
1301  ///< [OUT]
1302  size_t updateNameSize
1303  ///< [IN]
1304 );
1305 
1306 //--------------------------------------------------------------------------------------------------
1307 /**
1308  * Prevent any pending updates from being installed.
1309  *
1310  * @return
1311  * - Reference for block update request (to be used later for unblocking updates)
1312  * - NULL if the operation was not successful
1313  */
1314 //--------------------------------------------------------------------------------------------------
1316 (
1317  void
1318 );
1319 
1320 //--------------------------------------------------------------------------------------------------
1321 /**
1322  * Allow any pending updates to be installed
1323  */
1324 //--------------------------------------------------------------------------------------------------
1326 (
1327  le_avc_BlockRequestRef_t blockRef
1328  ///< [IN] block request ref returned by le_avc_BlockInstall
1329 );
1330 
1331 //--------------------------------------------------------------------------------------------------
1332 /**
1333  * Function to get error code when update fails.
1334  *
1335  * @return
1336  * - Error code of encountered error.
1337  * - ERR_NONE if update is in any other state.
1338  */
1339 //--------------------------------------------------------------------------------------------------
1341 (
1342  void
1343 );
1344 
1345 //--------------------------------------------------------------------------------------------------
1346 /**
1347  * Function to read the current session type, or the last session type if there is no
1348  * active session.
1349  *
1350  * @return
1351  * - SessionType
1352  */
1353 //--------------------------------------------------------------------------------------------------
1355 (
1356  void
1357 );
1358 
1359 //--------------------------------------------------------------------------------------------------
1360 /**
1361  * Function to read the http status of the last download.
1362  *
1363  * @return
1364  * - HttpStatus as defined in RFC 7231, Section 6.
1365  */
1366 //--------------------------------------------------------------------------------------------------
1367 uint16_t le_avc_GetHttpStatus
1368 (
1369  void
1370 );
1371 
1372 //--------------------------------------------------------------------------------------------------
1373 /**
1374  * Function to read the polling timer.
1375  *
1376  * @return
1377  * - LE_OK on success
1378  * - LE_FAULT if not available
1379  * - LE_OUT_OF_RANGE if the polling timer value is out of range (0 to 525600).
1380  */
1381 //--------------------------------------------------------------------------------------------------
1383 (
1384  uint32_t* pollingTimerPtr
1385  ///< [OUT] Polling timer
1386 );
1387 
1388 //--------------------------------------------------------------------------------------------------
1389 /**
1390  * Function to read the retry timers.
1391  *
1392  * @return
1393  * - LE_OK on success.
1394  * - LE_FAULT if not able to read the timers.
1395  * - LE_OUT_OF_RANGE if one of the retry timers is out of range (0 to 20160).
1396  */
1397 //--------------------------------------------------------------------------------------------------
1399 (
1400  uint16_t* timerValuePtr,
1401  ///< [OUT] Array of the retry timers.
1402  size_t* timerValueSizePtr
1403  ///< [INOUT]
1404 );
1405 
1406 //--------------------------------------------------------------------------------------------------
1407 /**
1408  * Function to read APN configuration.
1409  *
1410  * @return
1411  * - LE_OK on success.
1412  * - LE_FAULT if there is any error while reading.
1413  * - LE_OVERFLOW if the buffer provided is too small.
1414  */
1415 //--------------------------------------------------------------------------------------------------
1417 (
1418  char* apnName,
1419  ///< [OUT]
1420  size_t apnNameSize,
1421  ///< [IN]
1422  char* userName,
1423  ///< [OUT]
1424  size_t userNameSize,
1425  ///< [IN]
1426  char* userPwd,
1427  ///< [OUT]
1428  size_t userPwdSize
1429  ///< [IN]
1430 );
1431 
1432 //--------------------------------------------------------------------------------------------------
1433 /**
1434  * Function to write APN configuration.
1435  *
1436  * @return
1437  * - LE_OK on success.
1438  * - LE_OVERFLOW if one of the input strings is too long.
1439  */
1440 //--------------------------------------------------------------------------------------------------
1442 (
1443  const char* LE_NONNULL apnName,
1444  ///< [IN]
1445  const char* LE_NONNULL userName,
1446  ///< [IN]
1447  const char* LE_NONNULL userPwd
1448  ///< [IN]
1449 );
1450 
1451 //--------------------------------------------------------------------------------------------------
1452 /**
1453  * Function to set the polling timer.
1454  *
1455  * @return
1456  * - LE_OK on success.
1457  * - LE_OUT_OF_RANGE if the polling timer value is out of range (0 to 525600).
1458  */
1459 //--------------------------------------------------------------------------------------------------
1461 (
1462  uint32_t pollingTimer
1463  ///< [IN] Polling timer
1464 );
1465 
1466 //--------------------------------------------------------------------------------------------------
1467 /**
1468  * Function to set the retry timers.
1469  *
1470  * @return
1471  * - LE_OK on success.
1472  * - LE_FAULT if not able to set the timers.
1473  * - LE_OUT_OF_RANGE if one of the retry timers is out of range (0 to 20160).
1474  */
1475 //--------------------------------------------------------------------------------------------------
1477 (
1478  const uint16_t* timerValuePtr,
1479  ///< [IN] Array of 8 retry timers.
1480  size_t timerValueSize
1481  ///< [IN]
1482 );
1483 
1484 //--------------------------------------------------------------------------------------------------
1485 /**
1486  * Function to retrieve status of the credentials provisioned on the device.
1487  *
1488  * @return
1489  * LE_AVC_NO_CREDENTIAL_PROVISIONED
1490  * - If neither Bootstrap nor Device Management credential is provisioned.
1491  * LE_AVC_BS_CREDENTIAL_PROVISIONED
1492  * - If Bootstrap credential is provisioned but Device Management credential is
1493  * not provisioned.
1494  * LE_AVC_DM_CREDENTIAL_PROVISIONED
1495  * - If Device management key is provisioned.
1496  */
1497 //--------------------------------------------------------------------------------------------------
1499 (
1500  void
1501 );
1502 
1503 //--------------------------------------------------------------------------------------------------
1504 /**
1505  * Function to set user agreements for download, install, reboot, connection and uninstall.
1506  *
1507  * @return
1508  * - LE_OK on success.
1509  * - LE_FAULT if failed to configure user agreement.
1510  */
1511 //--------------------------------------------------------------------------------------------------
1513 (
1514  le_avc_UserAgreement_t updateStatus,
1515  ///< [IN] Operation for which user agreements has to be set.
1516  bool enable
1517  ///< [IN] true = enable, false = disable.
1518 );
1519 
1520 //--------------------------------------------------------------------------------------------------
1521 /**
1522  * Function to get user agreements for download, install, reboot, connection and uninstall.
1523  *
1524  * @return
1525  * - LE_OK on success.
1526  * - LE_FAULT if failed to read user agreement state.
1527  */
1528 //--------------------------------------------------------------------------------------------------
1530 (
1531  le_avc_UserAgreement_t updateStatus,
1532  ///< [IN] Operation for which user agreements has to be read.
1533  bool* enablePtr
1534  ///< [OUT] true = enable, false = disable.
1535 );
1536 
1537 #endif // LE_AVC_INTERFACE_H_INCLUDE_GUARD
void le_avc_RemoveSessionRequestEventHandler(le_avc_SessionRequestEventHandlerRef_t handlerRef)
le_result_t le_avc_GetPollingTimer(uint32_t *pollingTimerPtr)
Uninstall in progress.
Definition: le_avc_interface.h:778
Uninstall is pending.
Definition: le_avc_interface.h:776
Request by user app to close AV session.
Definition: le_avc_interface.h:845
User agreement for reboot.
Definition: le_avc_interface.h:830
User agreement for connection.
Definition: le_avc_interface.h:822
An error occurred installing the update.
Definition: le_avc_interface.h:774
le_result_t le_avc_DeferReboot(uint32_t deferMinutes)
le_result_t le_avc_SetRetryTimers(const uint16_t *timerValuePtr, size_t timerValueSize)
le_avc_SessionRequestEventHandlerRef_t le_avc_AddSessionRequestEventHandler(le_avc_SessionRequestHandlerFunc_t handlerPtr, void *contextPtr)
le_result_t le_avc_SetApnConfig(const char *LE_NONNULL apnName, const char *LE_NONNULL userName, const char *LE_NONNULL userPwd)
le_result_t le_avc_DeferConnect(uint32_t deferMinutes)
le_result_t
Definition: le_basics.h:35
le_avc_CommInfoHandlerRef_t le_avc_AddCommInfoHandler(le_avc_CommInfoHandlerFunc_t handlerPtr, void *contextPtr)
Package is certified sent by a trusted server.
Definition: le_avc_interface.h:807
void(* le_avc_SessionRequestHandlerFunc_t)(le_avc_SessionRequest_t request, void *contextPtr)
Definition: le_avc_interface.h:991
le_result_t le_avc_AcceptReboot(void)
An error occurred uninstalling the update.
Definition: le_avc_interface.h:782
void(* le_avc_CommInfoHandlerFunc_t)(uint8_t code, const char *LE_NONNULL str, void *contextPtr)
Definition: le_avc_interface.h:1004
Install in progress.
Definition: le_avc_interface.h:770
void le_avc_UnblockInstall(le_avc_BlockRequestRef_t blockRef)
Package is not certified sent by a trusted server.
Definition: le_avc_interface.h:809
void le_avc_SetServerDisconnectHandler(le_avc_DisconnectHandler_t disconnectHandler, void *contextPtr)
le_avc_StatusEventHandlerRef_t le_avc_AddStatusEventHandler(le_avc_StatusHandlerFunc_t handlerPtr, void *contextPtr)
struct le_avc_SessionRequestEventHandler * le_avc_SessionRequestEventHandlerRef_t
Definition: le_avc_interface.h:943
void le_avc_RemoveCommInfoHandler(le_avc_CommInfoHandlerRef_t handlerRef)
le_avc_SessionRequest_t
Definition: le_avc_interface.h:841
An error occurred downloading the update.
Definition: le_avc_interface.h:766
le_avc_UserAgreement_t
Definition: le_avc_interface.h:820
le_result_t le_avc_DeferUninstall(uint32_t deferMinutes)
Install is pending (implies download complete)
Definition: le_avc_interface.h:768
le_result_t le_avc_AcceptUninstall(void)
le_result_t le_avc_GetUpdateType(le_avc_UpdateType_t *updateTypePtr)
void(* le_avc_DisconnectHandler_t)(void *)
Definition: le_avc_interface.h:426
Definition: le_avc_interface.h:788
Session with AirVantage device management server started.
Definition: le_avc_interface.h:784
le_avc_SessionType_t
Definition: le_avc_interface.h:899
void(* le_avc_StatusHandlerFunc_t)(le_avc_Status_t updateStatus, int32_t totalNumBytes, int32_t progress, void *contextPtr)
Definition: le_avc_interface.h:968
Download in progress.
Definition: le_avc_interface.h:762
Definition: le_avc_interface.h:918
Device reboot is pending.
Definition: le_avc_interface.h:794
Session type invalid.
Definition: le_avc_interface.h:905
le_result_t le_avc_StartSession(void)
le_result_t le_avc_StopSession(void)
void le_avc_RemoveStatusEventHandler(le_avc_StatusEventHandlerRef_t handlerRef)
Definition: le_avc_interface.h:791
Definition: le_avc_interface.h:801
le_result_t le_avc_GetUserAgreement(le_avc_UserAgreement_t updateStatus, bool *enablePtr)
Update pending download.
Definition: le_avc_interface.h:760
User agreement for uninstall.
Definition: le_avc_interface.h:828
le_result_t le_avc_AcceptDownload(void)
le_result_t le_avc_TryConnectService(void)
le_result_t le_avc_CheckRoute(void)
le_result_t le_avc_DeferInstall(uint32_t deferMinutes)
Update has been successfully installed.
Definition: le_avc_interface.h:772
User agreement for install.
Definition: le_avc_interface.h:826
le_result_t le_avc_AcceptInstall(void)
Something failed while doing install/download.
Definition: le_avc_interface.h:885
User agreement for download.
Definition: le_avc_interface.h:824
Bootstrap session.
Definition: le_avc_interface.h:901
struct le_avc_BlockRequest * le_avc_BlockRequestRef_t
Definition: le_avc_interface.h:959
le_avc_BlockRequestRef_t le_avc_BlockInstall(void)
void le_avc_DisconnectService(void)
le_avc_SessionType_t le_avc_GetSessionType(void)
Session with bootstrap server started.
Definition: le_avc_interface.h:786
Device Management session.
Definition: le_avc_interface.h:903
No error.
Definition: le_avc_interface.h:881
le_result_t le_avc_SetUserAgreement(le_avc_UserAgreement_t updateStatus, bool enable)
Definition: le_avc_interface.h:921
Definition: le_avc_interface.h:796
le_result_t le_avc_GetApnConfig(char *apnName, size_t apnNameSize, char *userName, size_t userNameSize, char *userPwd, size_t userPwdSize)
le_avc_UpdateType_t
Definition: le_avc_interface.h:856
le_avc_CredentialStatus_t le_avc_GetCredentialStatus(void)
le_result_t le_avc_DeferDownload(uint32_t deferMinutes)
le_result_t le_avc_SetPollingTimer(uint32_t pollingTimer)
Security check failure while installing the package.
Definition: le_avc_interface.h:887
Request by user app to open AV session.
Definition: le_avc_interface.h:843
le_result_t le_avc_GetAppUpdateName(char *updateName, size_t updateNameSize)
le_avc_ErrorCode_t
Definition: le_avc_interface.h:879
Download has completed.
Definition: le_avc_interface.h:764
le_result_t le_avc_GetRetryTimers(uint16_t *timerValuePtr, size_t *timerValueSizePtr)
No updates pending.
Definition: le_avc_interface.h:758
le_avc_CredentialStatus_t
Definition: le_avc_interface.h:916
struct le_avc_CommInfoHandler * le_avc_CommInfoHandlerRef_t
Definition: le_avc_interface.h:951
uint16_t le_avc_GetHttpStatus(void)
struct le_avc_StatusEventHandler * le_avc_StatusEventHandlerRef_t
Definition: le_avc_interface.h:935
Encountered a bad package.
Definition: le_avc_interface.h:883
le_avc_Status_t
Definition: le_avc_interface.h:756
App has been successfully uninstalled.
Definition: le_avc_interface.h:780
Device Management credential is provisioned.
Definition: le_avc_interface.h:924
Definition: le_avc_interface.h:804
le_avc_ErrorCode_t le_avc_GetErrorCode(void)
void le_avc_ConnectService(void)