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  * Maximum length of a LwM2M resource excluding any termination character.
595  */
596 //--------------------------------------------------------------------------------------------------
597 #define LE_AVC_MAX_LWM2M_RESOURCE_LEN 512
598 
599 //--------------------------------------------------------------------------------------------------
600 /**
601  * Maximum length of a LwM2M resource. One extra byte is added for the null character.
602  */
603 //--------------------------------------------------------------------------------------------------
604 #define LE_AVC_MAX_LWM2M_RESOURCE_BYTES 513
605 
606 //--------------------------------------------------------------------------------------------------
607 /**
608  * Communication info codes
609  */
610 //--------------------------------------------------------------------------------------------------
611 #define LE_AVC_COMM_INFO_UDP_NO_ERR 0
612 
613 //--------------------------------------------------------------------------------------------------
614 /**
615  */
616 //--------------------------------------------------------------------------------------------------
617 #define LE_AVC_COMM_INFO_UDP_OPEN_ERR 1
618 
619 //--------------------------------------------------------------------------------------------------
620 /**
621  */
622 //--------------------------------------------------------------------------------------------------
623 #define LE_AVC_COMM_INFO_UDP_CLOSE_ERR 2
624 
625 //--------------------------------------------------------------------------------------------------
626 /**
627  */
628 //--------------------------------------------------------------------------------------------------
629 #define LE_AVC_COMM_INFO_UDP_SEND_ERR 3
630 
631 //--------------------------------------------------------------------------------------------------
632 /**
633  */
634 //--------------------------------------------------------------------------------------------------
635 #define LE_AVC_COMM_INFO_UDP_RECV_ERR 4
636 
637 //--------------------------------------------------------------------------------------------------
638 /**
639  */
640 //--------------------------------------------------------------------------------------------------
641 #define LE_AVC_COMM_INFO_UDP_CONNECT_ERR 5
642 
643 //--------------------------------------------------------------------------------------------------
644 /**
645  */
646 //--------------------------------------------------------------------------------------------------
647 #define LE_AVC_COMM_INFO_BEARER_UP 6
648 
649 //--------------------------------------------------------------------------------------------------
650 /**
651  */
652 //--------------------------------------------------------------------------------------------------
653 #define LE_AVC_COMM_INFO_BEARER_DOWN 7
654 
655 //--------------------------------------------------------------------------------------------------
656 /**
657  */
658 //--------------------------------------------------------------------------------------------------
659 #define LE_AVC_COMM_INFO_PDP_CONTEXT 8
660 
661 //--------------------------------------------------------------------------------------------------
662 /**
663  */
664 //--------------------------------------------------------------------------------------------------
665 #define LE_AVC_COMM_INFO_COAP_201_CREATED 65
666 
667 //--------------------------------------------------------------------------------------------------
668 /**
669  */
670 //--------------------------------------------------------------------------------------------------
671 #define LE_AVC_COMM_INFO_COAP_202_DELETED 66
672 
673 //--------------------------------------------------------------------------------------------------
674 /**
675  */
676 //--------------------------------------------------------------------------------------------------
677 #define LE_AVC_COMM_INFO_COAP_204_CHANGED 68
678 
679 //--------------------------------------------------------------------------------------------------
680 /**
681  */
682 //--------------------------------------------------------------------------------------------------
683 #define LE_AVC_COMM_INFO_COAP_205_CONTENT 69
684 
685 //--------------------------------------------------------------------------------------------------
686 /**
687  */
688 //--------------------------------------------------------------------------------------------------
689 #define LE_AVC_COMM_INFO_COAP_231_CONTINUE 95
690 
691 //--------------------------------------------------------------------------------------------------
692 /**
693  */
694 //--------------------------------------------------------------------------------------------------
695 #define LE_AVC_COMM_INFO_COAP_400_BAD_REQUEST 128
696 
697 //--------------------------------------------------------------------------------------------------
698 /**
699  */
700 //--------------------------------------------------------------------------------------------------
701 #define LE_AVC_COMM_INFO_COAP_401_UNAUTHORIZED 129
702 
703 //--------------------------------------------------------------------------------------------------
704 /**
705  */
706 //--------------------------------------------------------------------------------------------------
707 #define LE_AVC_COMM_INFO_COAP_402_BAD_OPTION 130
708 
709 //--------------------------------------------------------------------------------------------------
710 /**
711  */
712 //--------------------------------------------------------------------------------------------------
713 #define LE_AVC_COMM_INFO_COAP_404_NOT_FOUND 132
714 
715 //--------------------------------------------------------------------------------------------------
716 /**
717  */
718 //--------------------------------------------------------------------------------------------------
719 #define LE_AVC_COMM_INFO_COAP_405_METHOD_NOT_ALLOWED 133
720 
721 //--------------------------------------------------------------------------------------------------
722 /**
723  */
724 //--------------------------------------------------------------------------------------------------
725 #define LE_AVC_COMM_INFO_COAP_406_NOT_ACCEPTABLE 134
726 
727 //--------------------------------------------------------------------------------------------------
728 /**
729  */
730 //--------------------------------------------------------------------------------------------------
731 #define LE_AVC_COMM_INFO_COAP_408_REQ_ENTITY_INCOMPLETE 136
732 
733 //--------------------------------------------------------------------------------------------------
734 /**
735  */
736 //--------------------------------------------------------------------------------------------------
737 #define LE_AVC_COMM_INFO_COAP_412_PRECONDITION_FAILED 140
738 
739 //--------------------------------------------------------------------------------------------------
740 /**
741  */
742 //--------------------------------------------------------------------------------------------------
743 #define LE_AVC_COMM_INFO_COAP_413_ENTITY_TOO_LARGE 141
744 
745 //--------------------------------------------------------------------------------------------------
746 /**
747  */
748 //--------------------------------------------------------------------------------------------------
749 #define LE_AVC_COMM_INFO_COAP_500_INTERNAL_SERVER_ERROR 160
750 
751 //--------------------------------------------------------------------------------------------------
752 /**
753  */
754 //--------------------------------------------------------------------------------------------------
755 #define LE_AVC_COMM_INFO_COAP_501_NOT_IMPLEMENTED 161
756 
757 //--------------------------------------------------------------------------------------------------
758 /**
759  */
760 //--------------------------------------------------------------------------------------------------
761 #define LE_AVC_COMM_INFO_COAP_503_SERVICE_UNAVAILABLE 163
762 
763 //--------------------------------------------------------------------------------------------------
764 /**
765  * Status of session or update
766  *
767  * If an update is pending, it must first be downloaded and then installed.
768  */
769 //--------------------------------------------------------------------------------------------------
770 typedef enum
771 {
773  ///< No updates pending
775  ///< Update pending download
777  ///< Download in progress
779  ///< Download has completed
781  ///< An error occurred downloading the update
783  ///< Install is pending (implies download complete)
785  ///< Install in progress
787  ///< Update has been successfully installed
789  ///< An error occurred installing the update
791  ///< Uninstall is pending
793  ///< Uninstall in progress
795  ///< App has been successfully uninstalled
797  ///< An error occurred uninstalling the update
799  ///< Session with AirVantage device management server started
801  ///< Session with bootstrap server started
803  ///< Session with AirVantage device management server or bootstrap
804  ///< server stopped
806  ///< Session with AirVantage device management server or bootstrap
807  ///< server failed
809  ///< Device reboot is pending
811  ///< Connection to the server is required. This is necessary when
812  ///< firmware package is installed (after a platform reboot). Also
813  ///< necessary after software update if device reboots(or session stops)
814  ///< in the middle of software update.
816  ///< Authentication with AirVantage device management server or
817  ///< bootstrap server started
819  ///< Authentication with AirVantage device management server or
820  ///< bootstrap server failed
822  ///< Package is certified sent by a trusted server
824  ///< Package is not certified sent by a trusted server
825 }
827 
828 
829 //--------------------------------------------------------------------------------------------------
830 /**
831  * Operations which require user agreement
832  */
833 //--------------------------------------------------------------------------------------------------
834 typedef enum
835 {
837  ///< User agreement for connection
839  ///< User agreement for download
841  ///< User agreement for install
843  ///< User agreement for uninstall
845  ///< User agreement for reboot
846 }
848 
849 
850 //--------------------------------------------------------------------------------------------------
851 /**
852  * Request to open or close avms session.
853  */
854 //--------------------------------------------------------------------------------------------------
855 typedef enum
856 {
858  ///< Request by user app to open AV session
860  ///< Request by user app to close AV session
861 }
863 
864 
865 //--------------------------------------------------------------------------------------------------
866 /**
867  * The type of pending update
868  */
869 //--------------------------------------------------------------------------------------------------
870 typedef enum
871 {
872  LE_AVC_UNKNOWN_UPDATE = 0,
873  ///<
874  LE_AVC_FIRMWARE_UPDATE = 1,
875  ///<
876  LE_AVC_FRAMEWORK_UPDATE = 2,
877  ///<
878  LE_AVC_APPLICATION_UPDATE = 3
879  ///<
880 }
882 
883 
884 //--------------------------------------------------------------------------------------------------
885 /**
886  * Error code used to provide diagnostic information after a failure (includes both download and
887  * install failure).
888  *
889  * @note
890  * Additional information may also be available in the target device's system log.
891  */
892 //--------------------------------------------------------------------------------------------------
893 typedef enum
894 {
896  ///< No error.
898  ///< Encountered a bad package.
900  ///< Something failed while doing install/download.
902  ///< Security check failure while installing the package.
903 }
905 
906 
907 //--------------------------------------------------------------------------------------------------
908 /**
909  * Session type indicates whether the device is connected to the bootstrap server or the
910  * device management server.
911  */
912 //--------------------------------------------------------------------------------------------------
913 typedef enum
914 {
916  ///< Bootstrap session.
918  ///< Device Management session.
920  ///< Session type invalid.
921 }
923 
924 
925 //--------------------------------------------------------------------------------------------------
926 /**
927  * Status of the device credentials
928  */
929 //--------------------------------------------------------------------------------------------------
930 typedef enum
931 {
933  ///< Neither Bootstrap nor Device Management
934  ///< credential is provisioned.
936  ///< Bootstrap credential is provisioned but Device
937  ///< Management credential is not provisioned.
939  ///< Device Management credential is provisioned.
940 }
942 
943 
944 //--------------------------------------------------------------------------------------------------
945 /**
946  * Reference type used by Add/Remove functions for EVENT 'le_avc_StatusEvent'
947  */
948 //--------------------------------------------------------------------------------------------------
949 typedef struct le_avc_StatusEventHandler* le_avc_StatusEventHandlerRef_t;
950 
951 
952 //--------------------------------------------------------------------------------------------------
953 /**
954  * Reference type used by Add/Remove functions for EVENT 'le_avc_SessionRequestEvent'
955  */
956 //--------------------------------------------------------------------------------------------------
957 typedef struct le_avc_SessionRequestEventHandler* le_avc_SessionRequestEventHandlerRef_t;
958 
959 
960 //--------------------------------------------------------------------------------------------------
961 /**
962  * Reference type used by Add/Remove functions for EVENT 'le_avc_CommInfo'
963  */
964 //--------------------------------------------------------------------------------------------------
965 typedef struct le_avc_CommInfoHandler* le_avc_CommInfoHandlerRef_t;
966 
967 
968 //--------------------------------------------------------------------------------------------------
969 /**
970  * Reference returned by BlockInstall function and used by UnblockInstall function
971  */
972 //--------------------------------------------------------------------------------------------------
973 typedef struct le_avc_BlockRequest* le_avc_BlockRequestRef_t;
974 
975 
976 //--------------------------------------------------------------------------------------------------
977 /**
978  * Handler for update availability status
979  */
980 //--------------------------------------------------------------------------------------------------
981 typedef void (*le_avc_StatusHandlerFunc_t)
982 (
983  le_avc_Status_t updateStatus,
984  ///< status of pending update, if available
985  int32_t totalNumBytes,
986  ///< Total number of bytes to be downloaded
987  ///< only valid when updateStatus is one of
988  ///< DOWNLOAD_PENDING, DOWNLOAD_IN_PROGRESS or DOWNLOAD_COMPLETE.
989  ///< returns -1 if value is unknown
990  int32_t progress,
991  ///< Task completion in percentage
992  ///< Valid when updateStatus is one of DOWNLOAD_IN_PROGRESS,
993  ///< INSTALL_IN_PROGRESS or UNINSTALL_IN_PROGRESS.
994  ///< returns -1 if value is unknown
995  void* contextPtr
996  ///<
997 );
998 
999 //--------------------------------------------------------------------------------------------------
1000 /**
1001  * Handler for receiving session open or close request.
1002  */
1003 //--------------------------------------------------------------------------------------------------
1004 typedef void (*le_avc_SessionRequestHandlerFunc_t)
1006  le_avc_SessionRequest_t request,
1007  ///< Request to open or close AV session
1008  void* contextPtr
1009  ///<
1010 );
1011 
1012 //--------------------------------------------------------------------------------------------------
1013 /**
1014  * Handler for receiving communication information.
1015  */
1016 //--------------------------------------------------------------------------------------------------
1017 typedef void (*le_avc_CommInfoHandlerFunc_t)
1019  uint8_t code,
1020  ///< Communication information code
1021  const char* LE_NONNULL str,
1022  ///< Communication information string
1023  void* contextPtr
1024  ///<
1025 );
1026 
1027 //--------------------------------------------------------------------------------------------------
1028 /**
1029  * Add handler function for EVENT 'le_avc_StatusEvent'
1030  *
1031  * This event provides information on update availability status
1032  */
1033 //--------------------------------------------------------------------------------------------------
1035 (
1036  le_avc_StatusHandlerFunc_t handlerPtr,
1037  ///< [IN]
1038  void* contextPtr
1039  ///< [IN]
1040 );
1041 
1042 //--------------------------------------------------------------------------------------------------
1043 /**
1044  * Remove handler function for EVENT 'le_avc_StatusEvent'
1045  */
1046 //--------------------------------------------------------------------------------------------------
1048 (
1050  ///< [IN]
1051 );
1052 
1053 //--------------------------------------------------------------------------------------------------
1054 /**
1055  * Add handler function for EVENT 'le_avc_SessionRequestEvent'
1056  *
1057  * This event provides information on session open or close request.
1058  */
1059 //--------------------------------------------------------------------------------------------------
1061 (
1063  ///< [IN]
1064  void* contextPtr
1065  ///< [IN]
1066 );
1067 
1068 //--------------------------------------------------------------------------------------------------
1069 /**
1070  * Remove handler function for EVENT 'le_avc_SessionRequestEvent'
1071  */
1072 //--------------------------------------------------------------------------------------------------
1074 (
1076  ///< [IN]
1077 );
1078 
1079 //--------------------------------------------------------------------------------------------------
1080 /**
1081  * Add handler function for EVENT 'le_avc_CommInfo'
1082  *
1083  * This event provides communication errors.
1084  */
1085 //--------------------------------------------------------------------------------------------------
1087 (
1088  le_avc_CommInfoHandlerFunc_t handlerPtr,
1089  ///< [IN]
1090  void* contextPtr
1091  ///< [IN]
1092 );
1093 
1094 //--------------------------------------------------------------------------------------------------
1095 /**
1096  * Remove handler function for EVENT 'le_avc_CommInfo'
1097  */
1098 //--------------------------------------------------------------------------------------------------
1100 (
1101  le_avc_CommInfoHandlerRef_t handlerRef
1102  ///< [IN]
1103 );
1104 
1105 //--------------------------------------------------------------------------------------------------
1106 /**
1107  * Start a session with the AirVantage server
1108  *
1109  * This will cause a query to be sent to the server, for pending updates.
1110  *
1111  * @return
1112  * - LE_OK if connection request has been sent.
1113  * - LE_FAULT on failure
1114  * - LE_DUPLICATE if already connected.
1115  */
1116 //--------------------------------------------------------------------------------------------------
1118 (
1119  void
1120 );
1121 
1122 //--------------------------------------------------------------------------------------------------
1123 /**
1124  * Stop a session with the AirVantage server
1125  *
1126  * If a download is in progress, then this suspends the download.
1127  *
1128  * @return
1129  * - LE_OK on success
1130  * - LE_FAULT on failure
1131  * - LE_DUPLICATE if already disconnected
1132  */
1133 //--------------------------------------------------------------------------------------------------
1135 (
1136  void
1137 );
1138 
1139 //--------------------------------------------------------------------------------------------------
1140 /**
1141  * Send a specific message to the server to be sure that the route between the device and the server
1142  * is available.
1143  * This API needs to be called when any package download is over (successfully or not) and before
1144  * sending any notification on asset data to the server.
1145  *
1146  * @return
1147  * - LE_OK when the treatment is launched
1148  * - LE_FAULT on failure
1149  * - LE_UNSUPPORTED when the API is not supported
1150  *
1151  */
1152 //--------------------------------------------------------------------------------------------------
1154 (
1155  void
1156 );
1157 
1158 //--------------------------------------------------------------------------------------------------
1159 /**
1160  * Defer the currently pending connection, for the given number of minutes
1161  *
1162  * @return
1163  * - LE_OK on success
1164  * - LE_FAULT on failure
1165  */
1166 //--------------------------------------------------------------------------------------------------
1168 (
1169  uint32_t deferMinutes
1170  ///< [IN]
1171 );
1172 
1173 //--------------------------------------------------------------------------------------------------
1174 /**
1175  * Accept the currently pending download
1176  *
1177  * @return
1178  * - LE_OK on success
1179  * - LE_FAULT on failure
1180  */
1181 //--------------------------------------------------------------------------------------------------
1183 (
1184  void
1185 );
1186 
1187 //--------------------------------------------------------------------------------------------------
1188 /**
1189  * Defer the currently pending download, for the given number of minutes
1190  *
1191  * @return
1192  * - LE_OK on success
1193  * - LE_FAULT on failure
1194  */
1195 //--------------------------------------------------------------------------------------------------
1197 (
1198  uint32_t deferMinutes
1199  ///< [IN]
1200 );
1201 
1202 //--------------------------------------------------------------------------------------------------
1203 /**
1204  * Accept the currently pending install
1205  *
1206  * @return
1207  * - LE_OK on success
1208  * - LE_FAULT on failure
1209  */
1210 //--------------------------------------------------------------------------------------------------
1212 (
1213  void
1214 );
1215 
1216 //--------------------------------------------------------------------------------------------------
1217 /**
1218  * Defer the currently pending install
1219  *
1220  * @return
1221  * - LE_OK on success
1222  * - LE_FAULT on failure
1223  */
1224 //--------------------------------------------------------------------------------------------------
1226 (
1227  uint32_t deferMinutes
1228  ///< [IN]
1229 );
1230 
1231 //--------------------------------------------------------------------------------------------------
1232 /**
1233  * Accept the currently pending uninstall
1234  *
1235  * @return
1236  * - LE_OK on success
1237  * - LE_FAULT on failure
1238  */
1239 //--------------------------------------------------------------------------------------------------
1241 (
1242  void
1243 );
1244 
1245 //--------------------------------------------------------------------------------------------------
1246 /**
1247  * Defer the currently pending uninstall
1248  *
1249  * @return
1250  * - LE_OK on success
1251  * - LE_FAULT on failure
1252  */
1253 //--------------------------------------------------------------------------------------------------
1255 (
1256  uint32_t deferMinutes
1257  ///< [IN]
1258 );
1259 
1260 //--------------------------------------------------------------------------------------------------
1261 /**
1262  * Accept the currently pending reboot
1263  *
1264  * @return
1265  * - LE_OK on success
1266  * - LE_FAULT on failure
1267  */
1268 //--------------------------------------------------------------------------------------------------
1270 (
1271  void
1272 );
1273 
1274 //--------------------------------------------------------------------------------------------------
1275 /**
1276  * Defer the currently pending reboot
1277  *
1278  * @return
1279  * - LE_OK on success
1280  * - LE_FAULT on failure
1281  */
1282 //--------------------------------------------------------------------------------------------------
1284 (
1285  uint32_t deferMinutes
1286  ///< [IN]
1287 );
1288 
1289 //--------------------------------------------------------------------------------------------------
1290 /**
1291  * Get the update type of the currently pending update
1292  *
1293  * @return
1294  * - LE_OK on success
1295  * - LE_FAULT if not available
1296  */
1297 //--------------------------------------------------------------------------------------------------
1299 (
1300  le_avc_UpdateType_t* updateTypePtr
1301  ///< [OUT]
1302 );
1303 
1304 //--------------------------------------------------------------------------------------------------
1305 /**
1306  * Get the name for the currently pending app update
1307  *
1308  * @return
1309  * - LE_OK on success
1310  * - LE_FAULT if not available, or isn't APPL_UPDATE type
1311  */
1312 //--------------------------------------------------------------------------------------------------
1314 (
1315  char* updateName,
1316  ///< [OUT]
1317  size_t updateNameSize
1318  ///< [IN]
1319 );
1320 
1321 //--------------------------------------------------------------------------------------------------
1322 /**
1323  * Prevent any pending updates from being installed.
1324  *
1325  * @return
1326  * - Reference for block update request (to be used later for unblocking updates)
1327  * - NULL if the operation was not successful
1328  */
1329 //--------------------------------------------------------------------------------------------------
1331 (
1332  void
1333 );
1334 
1335 //--------------------------------------------------------------------------------------------------
1336 /**
1337  * Allow any pending updates to be installed
1338  */
1339 //--------------------------------------------------------------------------------------------------
1341 (
1342  le_avc_BlockRequestRef_t blockRef
1343  ///< [IN] block request ref returned by le_avc_BlockInstall
1344 );
1345 
1346 //--------------------------------------------------------------------------------------------------
1347 /**
1348  * Function to get error code when update fails.
1349  *
1350  * @return
1351  * - Error code of encountered error.
1352  * - ERR_NONE if update is in any other state.
1353  */
1354 //--------------------------------------------------------------------------------------------------
1356 (
1357  void
1358 );
1359 
1360 //--------------------------------------------------------------------------------------------------
1361 /**
1362  * Function to read the current session type, or the last session type if there is no
1363  * active session.
1364  *
1365  * @return
1366  * - SessionType
1367  */
1368 //--------------------------------------------------------------------------------------------------
1370 (
1371  void
1372 );
1373 
1374 //--------------------------------------------------------------------------------------------------
1375 /**
1376  * Function to read the http status of the last download.
1377  *
1378  * @return
1379  * - HttpStatus as defined in RFC 7231, Section 6.
1380  */
1381 //--------------------------------------------------------------------------------------------------
1382 uint16_t le_avc_GetHttpStatus
1383 (
1384  void
1385 );
1386 
1387 //--------------------------------------------------------------------------------------------------
1388 /**
1389  * Function to read the polling timer.
1390  *
1391  * @return
1392  * - LE_OK on success
1393  * - LE_FAULT if not available
1394  * - LE_OUT_OF_RANGE if the polling timer value is out of range (0 to 525600).
1395  */
1396 //--------------------------------------------------------------------------------------------------
1398 (
1399  uint32_t* pollingTimerPtr
1400  ///< [OUT] Polling timer
1401 );
1402 
1403 //--------------------------------------------------------------------------------------------------
1404 /**
1405  * Function to read the retry timers.
1406  *
1407  * @return
1408  * - LE_OK on success.
1409  * - LE_FAULT if not able to read the timers.
1410  * - LE_OUT_OF_RANGE if one of the retry timers is out of range (0 to 20160).
1411  */
1412 //--------------------------------------------------------------------------------------------------
1414 (
1415  uint16_t* timerValuePtr,
1416  ///< [OUT] Array of the retry timers.
1417  size_t* timerValueSizePtr
1418  ///< [INOUT]
1419 );
1420 
1421 //--------------------------------------------------------------------------------------------------
1422 /**
1423  * Function to read APN configuration.
1424  *
1425  * @return
1426  * - LE_OK on success.
1427  * - LE_FAULT if there is any error while reading.
1428  * - LE_OVERFLOW if the buffer provided is too small.
1429  */
1430 //--------------------------------------------------------------------------------------------------
1432 (
1433  char* apnName,
1434  ///< [OUT]
1435  size_t apnNameSize,
1436  ///< [IN]
1437  char* userName,
1438  ///< [OUT]
1439  size_t userNameSize,
1440  ///< [IN]
1441  char* userPwd,
1442  ///< [OUT]
1443  size_t userPwdSize
1444  ///< [IN]
1445 );
1446 
1447 //--------------------------------------------------------------------------------------------------
1448 /**
1449  * Function to write APN configuration.
1450  *
1451  * @return
1452  * - LE_OK on success.
1453  * - LE_OVERFLOW if one of the input strings is too long.
1454  */
1455 //--------------------------------------------------------------------------------------------------
1457 (
1458  const char* LE_NONNULL apnName,
1459  ///< [IN]
1460  const char* LE_NONNULL userName,
1461  ///< [IN]
1462  const char* LE_NONNULL userPwd
1463  ///< [IN]
1464 );
1465 
1466 //--------------------------------------------------------------------------------------------------
1467 /**
1468  * Function to set the polling timer.
1469  *
1470  * @return
1471  * - LE_OK on success.
1472  * - LE_OUT_OF_RANGE if the polling timer value is out of range (0 to 525600).
1473  */
1474 //--------------------------------------------------------------------------------------------------
1476 (
1477  uint32_t pollingTimer
1478  ///< [IN] Polling timer
1479 );
1480 
1481 //--------------------------------------------------------------------------------------------------
1482 /**
1483  * Function to set the retry timers.
1484  *
1485  * @return
1486  * - LE_OK on success.
1487  * - LE_FAULT if not able to set the timers.
1488  * - LE_OUT_OF_RANGE if one of the retry timers is out of range (0 to 20160).
1489  */
1490 //--------------------------------------------------------------------------------------------------
1492 (
1493  const uint16_t* timerValuePtr,
1494  ///< [IN] Array of 8 retry timers.
1495  size_t timerValueSize
1496  ///< [IN]
1497 );
1498 
1499 //--------------------------------------------------------------------------------------------------
1500 /**
1501  * Function to retrieve status of the credentials provisioned on the device.
1502  *
1503  * @return
1504  * LE_AVC_NO_CREDENTIAL_PROVISIONED
1505  * - If neither Bootstrap nor Device Management credential is provisioned.
1506  * LE_AVC_BS_CREDENTIAL_PROVISIONED
1507  * - If Bootstrap credential is provisioned but Device Management credential is
1508  * not provisioned.
1509  * LE_AVC_DM_CREDENTIAL_PROVISIONED
1510  * - If Device management key is provisioned.
1511  */
1512 //--------------------------------------------------------------------------------------------------
1514 (
1515  void
1516 );
1517 
1518 //--------------------------------------------------------------------------------------------------
1519 /**
1520  * Function to set user agreements for download, install, reboot, connection and uninstall.
1521  *
1522  * @return
1523  * - LE_OK on success.
1524  * - LE_FAULT if failed to configure user agreement.
1525  */
1526 //--------------------------------------------------------------------------------------------------
1528 (
1529  le_avc_UserAgreement_t updateStatus,
1530  ///< [IN] Operation for which user agreements has to be set.
1531  bool enable
1532  ///< [IN] true = enable, false = disable.
1533 );
1534 
1535 //--------------------------------------------------------------------------------------------------
1536 /**
1537  * Function to get user agreements for download, install, reboot, connection and uninstall.
1538  *
1539  * @return
1540  * - LE_OK on success.
1541  * - LE_FAULT if failed to read user agreement state.
1542  */
1543 //--------------------------------------------------------------------------------------------------
1545 (
1546  le_avc_UserAgreement_t updateStatus,
1547  ///< [IN] Operation for which user agreements has to be read.
1548  bool* enablePtr
1549  ///< [OUT] true = enable, false = disable.
1550 );
1551 
1552 //--------------------------------------------------------------------------------------------------
1553 /**
1554  * Function to read a resource from a LWM2M object
1555  *
1556  * @return
1557  * - LE_OK on success.
1558  * - LE_FAULT if failed.
1559  * - LE_UNSUPPORTED if unsupported.
1560  */
1561 //--------------------------------------------------------------------------------------------------
1563 (
1564  uint16_t objectId,
1565  ///< [IN] Object identifier
1566  uint16_t objectInstanceId,
1567  ///< [IN] Object instance identifier
1568  uint16_t resourceId,
1569  ///< [IN] Resource identifier
1570  uint16_t resourceInstanceId,
1571  ///< [IN] Resource instance identifier
1572  char* data,
1573  ///< [OUT] String of requested resources to be read
1574  size_t dataSize
1575  ///< [IN]
1576 );
1577 
1578 #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:792
Uninstall is pending.
Definition: le_avc_interface.h:790
Request by user app to close AV session.
Definition: le_avc_interface.h:859
User agreement for reboot.
Definition: le_avc_interface.h:844
User agreement for connection.
Definition: le_avc_interface.h:836
An error occurred installing the update.
Definition: le_avc_interface.h:788
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:821
void(* le_avc_SessionRequestHandlerFunc_t)(le_avc_SessionRequest_t request, void *contextPtr)
Definition: le_avc_interface.h:1005
le_result_t le_avc_AcceptReboot(void)
An error occurred uninstalling the update.
Definition: le_avc_interface.h:796
void(* le_avc_CommInfoHandlerFunc_t)(uint8_t code, const char *LE_NONNULL str, void *contextPtr)
Definition: le_avc_interface.h:1018
Install in progress.
Definition: le_avc_interface.h:784
void le_avc_UnblockInstall(le_avc_BlockRequestRef_t blockRef)
Package is not certified sent by a trusted server.
Definition: le_avc_interface.h:823
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:957
void le_avc_RemoveCommInfoHandler(le_avc_CommInfoHandlerRef_t handlerRef)
le_avc_SessionRequest_t
Definition: le_avc_interface.h:855
An error occurred downloading the update.
Definition: le_avc_interface.h:780
le_avc_UserAgreement_t
Definition: le_avc_interface.h:834
le_result_t le_avc_DeferUninstall(uint32_t deferMinutes)
Install is pending (implies download complete)
Definition: le_avc_interface.h:782
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:802
Session with AirVantage device management server started.
Definition: le_avc_interface.h:798
le_avc_SessionType_t
Definition: le_avc_interface.h:913
void(* le_avc_StatusHandlerFunc_t)(le_avc_Status_t updateStatus, int32_t totalNumBytes, int32_t progress, void *contextPtr)
Definition: le_avc_interface.h:982
Download in progress.
Definition: le_avc_interface.h:776
Definition: le_avc_interface.h:932
Device reboot is pending.
Definition: le_avc_interface.h:808
Session type invalid.
Definition: le_avc_interface.h:919
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:805
Definition: le_avc_interface.h:815
le_result_t le_avc_GetUserAgreement(le_avc_UserAgreement_t updateStatus, bool *enablePtr)
Update pending download.
Definition: le_avc_interface.h:774
User agreement for uninstall.
Definition: le_avc_interface.h:842
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:786
User agreement for install.
Definition: le_avc_interface.h:840
le_result_t le_avc_AcceptInstall(void)
Something failed while doing install/download.
Definition: le_avc_interface.h:899
User agreement for download.
Definition: le_avc_interface.h:838
Bootstrap session.
Definition: le_avc_interface.h:915
struct le_avc_BlockRequest * le_avc_BlockRequestRef_t
Definition: le_avc_interface.h:973
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:800
Device Management session.
Definition: le_avc_interface.h:917
No error.
Definition: le_avc_interface.h:895
le_result_t le_avc_SetUserAgreement(le_avc_UserAgreement_t updateStatus, bool enable)
Definition: le_avc_interface.h:935
Definition: le_avc_interface.h:810
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:870
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:901
Request by user app to open AV session.
Definition: le_avc_interface.h:857
le_result_t le_avc_ReadLwm2mResource(uint16_t objectId, uint16_t objectInstanceId, uint16_t resourceId, uint16_t resourceInstanceId, char *data, size_t dataSize)
le_result_t le_avc_GetAppUpdateName(char *updateName, size_t updateNameSize)
le_avc_ErrorCode_t
Definition: le_avc_interface.h:893
Download has completed.
Definition: le_avc_interface.h:778
le_result_t le_avc_GetRetryTimers(uint16_t *timerValuePtr, size_t *timerValueSizePtr)
No updates pending.
Definition: le_avc_interface.h:772
le_avc_CredentialStatus_t
Definition: le_avc_interface.h:930
struct le_avc_CommInfoHandler * le_avc_CommInfoHandlerRef_t
Definition: le_avc_interface.h:965
uint16_t le_avc_GetHttpStatus(void)
struct le_avc_StatusEventHandler * le_avc_StatusEventHandlerRef_t
Definition: le_avc_interface.h:949
Encountered a bad package.
Definition: le_avc_interface.h:897
le_avc_Status_t
Definition: le_avc_interface.h:770
App has been successfully uninstalled.
Definition: le_avc_interface.h:794
Device Management credential is provisioned.
Definition: le_avc_interface.h:938
Definition: le_avc_interface.h:818
le_avc_ErrorCode_t le_avc_GetErrorCode(void)
void le_avc_ConnectService(void)