#include "returncodes.h"
Data Structures | |
struct | swi_update_Notification |
This struct contains the update process notification. More... | |
Typedefs | |
typedef enum swi_update_Event | swi_update_Event_t |
This enum lists the events that will notified by the Agent while an update process is running. | |
typedef struct swi_update_Notification | swi_update_Notification_t |
This struct contains the update process notification. | |
typedef rc_ReturnCode_t(* | swi_update_StatusNotifictionCB_t )(swi_update_Notification_t *indPtr) |
Callback to receive to receive update process notification. | |
typedef enum swi_update_Request | swi_update_Request_t |
This enum is used to send requests to the Agent in order to change the update process. | |
Enumerations | |
enum | swi_update_Event { SWI_UPDATE_NEW, SWI_UPDATE_DOWNLOAD_IN_PROGRESS, SWI_UPDATE_DOWNLOAD_OK, SWI_UPDATE_CRC_OK, SWI_UPDATE_UPDATE_IN_PROGRESS, SWI_UPDATE_FAILED, SWI_UPDATE_SUCCESSFUL, SWI_UPDATE_PAUSED } |
This enum lists the events that will notified by the Agent while an update process is running. More... | |
enum | swi_update_Request { SWI_UPDATE_REQ_PAUSE, SWI_UPDATE_REQ_RESUME, SWI_UPDATE_REQ_ABORT } |
This enum is used to send requests to the Agent in order to change the update process. More... | |
Functions | |
rc_ReturnCode_t | swi_update_Init () |
Initializes the module. | |
rc_ReturnCode_t | swi_update_Destroy () |
Destroys the Update library. | |
rc_ReturnCode_t | swi_update_RegisterStatusNotification (swi_update_StatusNotifictionCB_t cb) |
Registers to receive notification about update process. | |
rc_ReturnCode_t | swi_update_Request (swi_update_Request_t req) |
Requests to act on update process. |
Agent update process is working with the AirVantage services platform. The basic concepts are:
Here are some details on the update package:
The functionalities provided by this library are available for both applications that are targeted by an update request and for applications that only want to monitor and control the update process.
The API to deal with application/asset update request is documented here: swi_av_RegisterUpdateNotification function and related definitions in swi_airvantage.h API.
For more details on the update process, please read the Agent product documentation.
typedef struct swi_update_Notification swi_update_Notification_t |
This struct contains the update process notification.
Event | Event Details |
---|---|
SWI_UPDATE_NEW | N/A |
SWI_UPDATE_DOWNLOAD_IN_PROGRESS | Download percentage (e.g.: "15%") |
SWI_UPDATE_DOWNLOAD_OK | N/A |
SWI_UPDATE_CRC_OK | N/A |
SWI_UPDATE_UPDATE_IN_PROGRESS Cell | Name of the current component being updated (e.g.: "someasset.foo.bar") |
SWI_UPDATE_FAILED | Failure details (e.g. "CRC failed") |
SWI_UPDATE_SUCCESSFUL | N/A |
SWI_UPDATE_PAUSED | Current update step that will be resumed when SWI_UPDATE_REQ_RESUME is received |
typedef rc_ReturnCode_t(* swi_update_StatusNotifictionCB_t)(swi_update_Notification_t *indPtr) |
Callback to receive to receive update process notification.
indPtr | [IN] Update process event notification. The indication data will be released when the callback returns |
enum swi_update_Event |
This enum lists the events that will notified by the Agent while an update process is running.
enum swi_update_Request |
This enum is used to send requests to the Agent in order to change the update process.
rc_ReturnCode_t swi_update_Destroy | ( | ) |
Destroys the Update library.
rc_ReturnCode_t swi_update_Init | ( | ) |
Initializes the module.
A call to init is mandatory to enable Update library APIs.
rc_ReturnCode_t swi_update_RegisterStatusNotification | ( | swi_update_StatusNotifictionCB_t | cb | ) |
Registers to receive notification about update process.
The callback will be called in a new pthread.
cb | [IN] callback to register to receive software update, previous value is replaced. NULL value for the callback is interpreted as unregister request. |
Requests to act on update process.
If called within a swi_update_StatusNotifictionCB_t, then a Pause/Abort request will be processed right after the swi_update_StatusNotifictionCB_t has returned. Otherwise, a Pause/Abort request will be processed when the next update interruptible step will start.
RC_SERVICE_UNAVAILABLE if no update was in progress
RC_UNSPECIFIED_ERROR if the action can not be performed, e.g. trying to resume an update that is already running.
req | [IN] the request to send to the Agent in order to change the update process. |