Developer World
Spresense SDK Library v3.2.0-ebc0364
lte_fwupdate.h File Reference

LTE library for LTE firmware update. More...

#include <stdint.h>
#include <nuttx/wireless/lte/lte.h>
#include "lte_fw_def.h"

Go to the source code of this file.

Macros

#define EXTERN   extern "C"
 

Functions

Functions
int ltefwupdate_initialize (FAR const char *initial_data, int len)
 
int ltefwupdate_injectrest (FAR const char *rest_data, int len)
 
int ltefwupdate_injected_datasize (void)
 
int ltefwupdate_execute (void)
 
int ltefwupdate_result (void)
 

Detailed Description

LTE library for LTE firmware update.

API call type

Sync API
ltefwupdate_initialize
ltefwupdate_injectrest
ltefwupdate_injected_datasize
ltefwupdate_execute
ltefwupdate_result
Attention
This API notifies the progress of the update by the callback set by lte_set_report_restart(). You must call lte_set_report_restart() before lte_power_on().

Function Documentation

◆ ltefwupdate_initialize()

int ltefwupdate_initialize ( FAR const char *  initial_data,
int  len 
)

Initialze injection delta image to LTE modem.

Initialize LTE modem delta image injection with some data of top of delta image.

Parameters
[in]initial_dataPointer to top data of update image.
[in]lenSize of initial_data.
Returns
Positive value is the injected length. Negative value is any error. In error case, the value can be below values.

◆ ltefwupdate_injectrest()

int ltefwupdate_injectrest ( FAR const char *  rest_data,
int  len 
)

Inject rest delta image to LTE modem.

Inject the rest of the delta image following the data injected by the ltefwupdate_initialize() and ltefwupdate_injectrest() functions.

Parameters
[in]rest_dataPointer to rest data of update image.
[in]lenSize of rest_data.
Returns
Positive value is the injected length. Negative value is any error. In error case, the value can be below values.

◆ ltefwupdate_injected_datasize()

int ltefwupdate_injected_datasize ( void  )

Get length of injected delta image file.

Returns
On success, The length of injected data to the modem is returned. On failure, a negative value is returned according to <errno.h>.

◆ ltefwupdate_execute()

int ltefwupdate_execute ( void  )

Execute delta update.

Attention
When this function is executed, the modem is automatically rebooted multiple times. The progress of the update can be checked by the callback set by lte_set_report_restart(). Before executing this function, the modem must be woken up using lte_acquire_wakelock() to safely update the modem. Then lte_release_wakelock() is executed when the callback set by lte_set_report_restart() is called.
Returns
On success, 0 is returned. On failure, negative value is returned as below values.

◆ ltefwupdate_result()

int ltefwupdate_result ( void  )

Get the result of delta update. Execute this function after LTE_RESTART_MODEM_UPDATED is notified to the callback set by lte_set_report_restart().

Returns
On success, 0 is returned. On failure, negative value is returned as below values.