le_avc_interface.h
Go to the documentation of this file.
36 * server, download/install packages and reboots the target if needed. Thus, if no control app for37 * the AirVantage service is present on the target, the daemon is still able to update the target.39 * User agreements are persistent to reboot/update, they are stored in the file system. The default40 * settings are only applied when the target boots the first time or when the configuration file is41 * missing or corrupted. In all other cases, default configuration never overwrites the current one.43 * When writing a control app for the AirVantage Service, it is up to the developer to ensure that44 * user agreements have been enabled for all actions the control app performs. Otherwise, avcService59 * notification is connection pending or by accepting or deferring the operation if the notification62 * Whether avcService should forward these notifications to an app or act on these notifications by85 * The current session can be stopped using le_avc_StopSession(). This cancels any query for pending86 * update, or suspends a download in progress; however, it <b>won't stop</b> an install in progress.115 * @c avcService will open a session to proceed with the download. In this case, a session started121 * le_avc_GetUpdateType(). App updates can call le_avc_GetAppUpdateName() to retrieve the App name.126 * specified number of minutes. After the defer time has elapsed, the pending download notification127 * will be re-sent again to all registered apps. le_avc_AcceptDownload() can be used to accept the134 * If an uninstall is pending, then le_avc_AcceptUninstall() can be used to allow the uninstall to135 * proceed. To defer the decision, le_avc_DeferUninstall() can be used to defer the uninstall for137 * uninstalled after le_avc_AcceptUninstall() is called. le_avc_AcceptUninstall() is only used to138 * signal the server to start downloading the new application. To proceed with an upgrade process,139 * accept the uninstall of the existing version followed by accepting the download and install of187 * @note Even if an App calls le_avc_AcceptInstall(), the install may still be blocked by another189 * le_avc_DeferInstall() to defer the install for the specified number of minutes. After the defer190 * time has elapsed, the pending install notification will be re-sent to allow Apps to make a new197 * is active. An App should start an AirVantage session before accepting an App install/uninstall,201 * then any pending downloads and installs will happen automatically, subject to any restrictions206 * In case of any error incurred during App download/install, an error code will be set which can be223 * An App can add a session control handler using le_avc_AddSessionRequestEventHandler(). Requests224 * by user Apps to open or close session will be forwarded to the session control handler. If no App237 * - If the user agreements are enabled, the previous @c PENDING notification is sent to the App,241 * minutes), e.g. in some cases of firmware update. The @c PENDING notification will therefore be242 * sent only when the suspension is over. Trying to resume the update process while the suspension246 * |--------------------------------|-------------------------------------------------------------|--------------------------|248 * | @c LE_AVC_DOWNLOAD_IN_PROGRESS | @c LE_AVC_DOWNLOAD_PENDING with remaining bytes to download | Accept download |249 * | @c LE_AVC_DOWNLOAD_COMPLETE | @c LE_AVC_DOWNLOAD_PENDING with zero bytes to download | Accept download |256 * all suspend/resume information stored by avcService is erased. So if developer updates firmware257 * or legato (via ethernet or ecm etc.) in the middle of any update initiated by avcService, this262 * Polling timers sets the time that the Target will communicate with the AirVantage Server to check270 * initiate a session when it starts the count (at 0 minutes) and then again at the specified time275 * The polling timer accepts ranges from 0 to 525600 minutes. The polling timer does not get reset277 * connect to the AVC Server upon startup of the app. For example, if the polling timer is set to 1278 * hour then and the target reboots at the 20 minute mark, the polling timer will still initiate a279 * connection at the 1 hour mark. If the target is powered off or in the middle of rebooting at the280 * 1 hour mark, as soon as the app is started again, the polling timer will initiate a connection to283 * Polling timer initiated sessions will be disconnected after 20 seconds of inactivity. This does284 * not apply to AirVantage sessions that have been initiated by an app. The app is responsible for285 * disconnecting the session it initiates within a reasonable timeframe. Leaving the session open292 * Writing to the polling timer stops the current polling timer if it is running and starts a timer293 * with the new value. The next connection will be initiated when the new polling timer reaches it's302 * The timers are tried in sequence until a connection is established, or all enabled retry timers303 * are exhausted. After all the enabled timers are exhausted, a new session must be initiated again315 * Example of calling retry timers, the session will be retried after 15 minutes, 1 hour, 4 hours,324 * The AirVantage server can request to reboot the device. If a reboot is requested a notification325 * is sent to the registered Apps. The App can either accept the reboot with le_avc_AcceptReboot()327 * has elapsed, the pending reboot notification will be re-sent. This allows the registered app to342 * software update (after finishing software update on reboot). In this case a notification is sent347 * By default the AirVantage connection uses the default mobile data profile and the default route350 * If the user wishes to control the network configuration, e.g. to use the AirVantage agent with359 * The data connection service should then be configured before launching the AirVantage connection:370 * 300 seconds to establish a connection. Download will also be aborted, if the download speed is393 * After an AirVantage session is started, if there's no activity between the device and the server396 * /apps/avcService/activityTimeout. The activity timer is initialized only when the @c avcService430 //--------------------------------------------------------------------------------------------------434 //--------------------------------------------------------------------------------------------------437 //--------------------------------------------------------------------------------------------------440 * Connect the current client thread to the service providing this API. Block until the service is443 * For each thread that wants to use this API, either ConnectService or TryConnectService must be444 * called before any other functions in this API. Normally, ConnectService is automatically called449 //--------------------------------------------------------------------------------------------------455 //--------------------------------------------------------------------------------------------------458 * Try to connect the current client thread to the service providing this API. Return with an error461 * For each thread that wants to use this API, either ConnectService or TryConnectService must be462 * called before any other functions in this API. Normally, ConnectService is automatically called471 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).474 //--------------------------------------------------------------------------------------------------480 //--------------------------------------------------------------------------------------------------484 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants487 //--------------------------------------------------------------------------------------------------494 //--------------------------------------------------------------------------------------------------500 * longer a connection to the service, and the functions in this API can't be used. For details, see505 //--------------------------------------------------------------------------------------------------512 //--------------------------------------------------------------------------------------------------516 //--------------------------------------------------------------------------------------------------519 //--------------------------------------------------------------------------------------------------523 //--------------------------------------------------------------------------------------------------526 //--------------------------------------------------------------------------------------------------530 //--------------------------------------------------------------------------------------------------533 //--------------------------------------------------------------------------------------------------537 //--------------------------------------------------------------------------------------------------540 //--------------------------------------------------------------------------------------------------544 //--------------------------------------------------------------------------------------------------547 //--------------------------------------------------------------------------------------------------551 //--------------------------------------------------------------------------------------------------554 //--------------------------------------------------------------------------------------------------558 //--------------------------------------------------------------------------------------------------561 //--------------------------------------------------------------------------------------------------565 //--------------------------------------------------------------------------------------------------568 //--------------------------------------------------------------------------------------------------571 //--------------------------------------------------------------------------------------------------574 //--------------------------------------------------------------------------------------------------578 //--------------------------------------------------------------------------------------------------581 //--------------------------------------------------------------------------------------------------584 //--------------------------------------------------------------------------------------------------587 //--------------------------------------------------------------------------------------------------591 //--------------------------------------------------------------------------------------------------594 //--------------------------------------------------------------------------------------------------598 //--------------------------------------------------------------------------------------------------601 //--------------------------------------------------------------------------------------------------605 //--------------------------------------------------------------------------------------------------608 //--------------------------------------------------------------------------------------------------612 //--------------------------------------------------------------------------------------------------615 //--------------------------------------------------------------------------------------------------619 //--------------------------------------------------------------------------------------------------622 //--------------------------------------------------------------------------------------------------625 //--------------------------------------------------------------------------------------------------628 //--------------------------------------------------------------------------------------------------631 //--------------------------------------------------------------------------------------------------634 //--------------------------------------------------------------------------------------------------637 //--------------------------------------------------------------------------------------------------640 //--------------------------------------------------------------------------------------------------643 //--------------------------------------------------------------------------------------------------646 //--------------------------------------------------------------------------------------------------649 //--------------------------------------------------------------------------------------------------652 //--------------------------------------------------------------------------------------------------655 //--------------------------------------------------------------------------------------------------658 //--------------------------------------------------------------------------------------------------661 //--------------------------------------------------------------------------------------------------664 //--------------------------------------------------------------------------------------------------667 //--------------------------------------------------------------------------------------------------670 //--------------------------------------------------------------------------------------------------673 //--------------------------------------------------------------------------------------------------676 //--------------------------------------------------------------------------------------------------679 //--------------------------------------------------------------------------------------------------682 //--------------------------------------------------------------------------------------------------685 //--------------------------------------------------------------------------------------------------688 //--------------------------------------------------------------------------------------------------691 //--------------------------------------------------------------------------------------------------694 //--------------------------------------------------------------------------------------------------697 //--------------------------------------------------------------------------------------------------700 //--------------------------------------------------------------------------------------------------703 //--------------------------------------------------------------------------------------------------706 //--------------------------------------------------------------------------------------------------709 //--------------------------------------------------------------------------------------------------712 //--------------------------------------------------------------------------------------------------715 //--------------------------------------------------------------------------------------------------718 //--------------------------------------------------------------------------------------------------721 //--------------------------------------------------------------------------------------------------724 //--------------------------------------------------------------------------------------------------727 //--------------------------------------------------------------------------------------------------730 //--------------------------------------------------------------------------------------------------733 //--------------------------------------------------------------------------------------------------736 //--------------------------------------------------------------------------------------------------739 //--------------------------------------------------------------------------------------------------742 //--------------------------------------------------------------------------------------------------745 //--------------------------------------------------------------------------------------------------748 //--------------------------------------------------------------------------------------------------751 //--------------------------------------------------------------------------------------------------754 //--------------------------------------------------------------------------------------------------757 //--------------------------------------------------------------------------------------------------760 //--------------------------------------------------------------------------------------------------763 //--------------------------------------------------------------------------------------------------766 //--------------------------------------------------------------------------------------------------769 //--------------------------------------------------------------------------------------------------772 //--------------------------------------------------------------------------------------------------778 //--------------------------------------------------------------------------------------------------838 //--------------------------------------------------------------------------------------------------842 //--------------------------------------------------------------------------------------------------859 //--------------------------------------------------------------------------------------------------863 //--------------------------------------------------------------------------------------------------874 //--------------------------------------------------------------------------------------------------878 //--------------------------------------------------------------------------------------------------893 //--------------------------------------------------------------------------------------------------901 //--------------------------------------------------------------------------------------------------916 //--------------------------------------------------------------------------------------------------921 //--------------------------------------------------------------------------------------------------934 //--------------------------------------------------------------------------------------------------938 //--------------------------------------------------------------------------------------------------953 //--------------------------------------------------------------------------------------------------957 //--------------------------------------------------------------------------------------------------961 //--------------------------------------------------------------------------------------------------965 //--------------------------------------------------------------------------------------------------969 //--------------------------------------------------------------------------------------------------973 //--------------------------------------------------------------------------------------------------977 //--------------------------------------------------------------------------------------------------981 //--------------------------------------------------------------------------------------------------985 //--------------------------------------------------------------------------------------------------989 //--------------------------------------------------------------------------------------------------991 (1008 //--------------------------------------------------------------------------------------------------1012 //--------------------------------------------------------------------------------------------------1014 (1021 //--------------------------------------------------------------------------------------------------1025 //--------------------------------------------------------------------------------------------------1027 (1036 //--------------------------------------------------------------------------------------------------1042 //--------------------------------------------------------------------------------------------------1051 //--------------------------------------------------------------------------------------------------1055 //--------------------------------------------------------------------------------------------------1062 //--------------------------------------------------------------------------------------------------1068 //--------------------------------------------------------------------------------------------------1077 //--------------------------------------------------------------------------------------------------1081 //--------------------------------------------------------------------------------------------------1088 //--------------------------------------------------------------------------------------------------1094 //--------------------------------------------------------------------------------------------------1103 //--------------------------------------------------------------------------------------------------1107 //--------------------------------------------------------------------------------------------------1114 //--------------------------------------------------------------------------------------------------1125 //--------------------------------------------------------------------------------------------------1131 //--------------------------------------------------------------------------------------------------1142 //--------------------------------------------------------------------------------------------------1148 //--------------------------------------------------------------------------------------------------1150 * Send a specific message to the server to be sure that the route between the device and the server1152 * This API needs to be called when any package download is over (successfully or not) and before1161 //--------------------------------------------------------------------------------------------------1167 //--------------------------------------------------------------------------------------------------1175 //--------------------------------------------------------------------------------------------------1182 //--------------------------------------------------------------------------------------------------1190 //--------------------------------------------------------------------------------------------------1196 //--------------------------------------------------------------------------------------------------1204 //--------------------------------------------------------------------------------------------------1211 //--------------------------------------------------------------------------------------------------1219 //--------------------------------------------------------------------------------------------------1225 //--------------------------------------------------------------------------------------------------1233 //--------------------------------------------------------------------------------------------------1240 //--------------------------------------------------------------------------------------------------1248 //--------------------------------------------------------------------------------------------------1254 //--------------------------------------------------------------------------------------------------1262 //--------------------------------------------------------------------------------------------------1269 //--------------------------------------------------------------------------------------------------1280 //--------------------------------------------------------------------------------------------------1286 //--------------------------------------------------------------------------------------------------1294 //--------------------------------------------------------------------------------------------------1301 //--------------------------------------------------------------------------------------------------1309 //--------------------------------------------------------------------------------------------------1316 //--------------------------------------------------------------------------------------------------1324 //--------------------------------------------------------------------------------------------------1333 //--------------------------------------------------------------------------------------------------1341 //--------------------------------------------------------------------------------------------------1347 //--------------------------------------------------------------------------------------------------1351 //--------------------------------------------------------------------------------------------------1358 //--------------------------------------------------------------------------------------------------1366 //--------------------------------------------------------------------------------------------------1372 //--------------------------------------------------------------------------------------------------1380 //--------------------------------------------------------------------------------------------------1386 //--------------------------------------------------------------------------------------------------1393 //--------------------------------------------------------------------------------------------------1399 //--------------------------------------------------------------------------------------------------1408 //--------------------------------------------------------------------------------------------------1415 //--------------------------------------------------------------------------------------------------1424 //--------------------------------------------------------------------------------------------------1433 //--------------------------------------------------------------------------------------------------1442 //--------------------------------------------------------------------------------------------------1459 //--------------------------------------------------------------------------------------------------1467 //--------------------------------------------------------------------------------------------------1478 //--------------------------------------------------------------------------------------------------1486 //--------------------------------------------------------------------------------------------------1493 //--------------------------------------------------------------------------------------------------1502 //--------------------------------------------------------------------------------------------------1511 //--------------------------------------------------------------------------------------------------1524 //--------------------------------------------------------------------------------------------------1530 //--------------------------------------------------------------------------------------------------1538 //--------------------------------------------------------------------------------------------------1547 //--------------------------------------------------------------------------------------------------1555 //--------------------------------------------------------------------------------------------------1564 //--------------------------------------------------------------------------------------------------1573 //--------------------------------------------------------------------------------------------------void le_avc_RemoveSessionRequestEventHandler(le_avc_SessionRequestEventHandlerRef_t handlerRef)le_result_t le_avc_GetPollingTimer(uint32_t *pollingTimerPtr)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_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:830void(* le_avc_SessionRequestHandlerFunc_t)(le_avc_SessionRequest_t request, void *contextPtr)Definition: le_avc_interface.h:1014le_result_t le_avc_AcceptReboot(void)An error occurred uninstalling the update.Definition: le_avc_interface.h:805void(* le_avc_CommInfoHandlerFunc_t)(uint8_t code, const char *LE_NONNULL str, void *contextPtr)Definition: le_avc_interface.h:1027void le_avc_UnblockInstall(le_avc_BlockRequestRef_t blockRef)Package is not certified sent by a trusted server.Definition: le_avc_interface.h:832void 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_tDefinition: le_avc_interface.h:966void le_avc_RemoveCommInfoHandler(le_avc_CommInfoHandlerRef_t handlerRef)le_result_t le_avc_DeferUninstall(uint32_t deferMinutes)Install is pending (implies download complete)Definition: le_avc_interface.h:791le_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:435Definition: le_avc_interface.h:811Session with AirVantage device management server started.Definition: le_avc_interface.h:807void(* le_avc_StatusHandlerFunc_t)(le_avc_Status_t updateStatus, int32_t totalNumBytes, int32_t progress, void *contextPtr)Definition: le_avc_interface.h:991Definition: le_avc_interface.h:941le_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:814Definition: le_avc_interface.h:824le_result_t le_avc_GetUserAgreement(le_avc_UserAgreement_t updateStatus, bool *enablePtr)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)le_result_t le_avc_AcceptInstall(void)Something failed while doing install/download.Definition: le_avc_interface.h:908struct le_avc_BlockRequest * le_avc_BlockRequestRef_tDefinition: le_avc_interface.h:982le_avc_BlockRequestRef_t le_avc_BlockInstall(void)void le_avc_DisconnectService(void)le_avc_SessionType_t le_avc_GetSessionType(void)le_result_t le_avc_SetUserAgreement(le_avc_UserAgreement_t updateStatus, bool enable)Definition: le_avc_interface.h:944Definition: le_avc_interface.h:819le_result_t le_avc_GetApnConfig(char *apnName, size_t apnNameSize, char *userName, size_t userNameSize, char *userPwd, size_t userPwdSize)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:910le_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_result_t le_avc_GetRetryTimers(uint16_t *timerValuePtr, size_t *timerValueSizePtr)struct le_avc_CommInfoHandler * le_avc_CommInfoHandlerRef_tDefinition: le_avc_interface.h:974uint16_t le_avc_GetHttpStatus(void)struct le_avc_StatusEventHandler * le_avc_StatusEventHandlerRef_tDefinition: le_avc_interface.h:958Device Management credential is provisioned.Definition: le_avc_interface.h:947Definition: le_avc_interface.h:827le_avc_ErrorCode_t le_avc_GetErrorCode(void)void le_avc_ConnectService(void)