This module contains APIs to program and use the FOTA Agent driver.
◆ FOTAAGENT_WRITEOFFSET_DNC
| #define FOTAAGENT_WRITEOFFSET_DNC (0U) |
◆ FOTAAgent_Params_init()
Initilize params with default values.
- Parameters
-
| params | pointer to parameter struct |
- Returns
- SystemP_FAILURE
-
SystemP_SUCCESS
◆ FOTAAgent_init()
Initilize FOTA Agent API.
This API initilize FOTA agent and underneath modules.
- Parameters
-
| pHandle | pointer to FOTA Agent handle |
| params | pointer to parameter struct |
- Returns
- SystemP_FAILURE
-
SystemP_SUCCESS
◆ FOTAAgent_writeStart()
| int32_t FOTAAgent_writeStart |
( |
FOTAAgent_Handle * |
pHandle, |
|
|
uint32_t |
wrOffset, |
|
|
char |
doFlashSegments |
|
) |
| |
Logically start writes and initilize state internal machine.
Currently, FOTAAgent only support binary file of format .mcelf and .mcelf_xip. if file type is mcelf_xip then doFlashSegments is TRUE else it is FALSE. doFlashSegments here signals to parse the file, extracts the data segments and only flash those data segments, instead of entire file.
In case doFlashSegments is TRUE, wrOffset argument is ignored as this information is stored inside the file. However, wrOffset information needs to be provided explicitly given via wrOffset argument.
wrOffset argument is the offset (in bytes) at which file needs to be written.
- Parameters
-
| pHandle | pointer to FOTA Agent handle |
| wrOffset | flash offset at which file to write |
| doFlashSegments | flash data segments only instead of entire file |
- Returns
- SystemP_FAILURE
-
SystemP_SUCCESS
◆ FOTAAgent_writeUpdate()
| int32_t FOTAAgent_writeUpdate |
( |
FOTAAgent_Handle * |
pHandle, |
|
|
uint8_t * |
buf, |
|
|
uint32_t |
size |
|
) |
| |
Update internal machine with new data.
Update internal state machine with new data. Its not that on providing every one byte this function will write to flash. Flash constraints on erase size. For exmaple, if erase is sector wise of 4096 bytes (as specified in params) then in that case, this function will wait for this amount of data to be recieved and then send it to the flash.
- Parameters
-
| pHandle | pointer to FOTA Agent handle |
| buf | pointer to buffer with the data |
| size | size of buf |
- Returns
- SystemP_FAILURE
-
SystemP_SUCCESS
◆ FOTAAgent_writeEnd()
Logically end writes and end the state machine.
Other than ending the internal state machine, this function will also flash any remaining data that remains to be programmed.
- Parameters
-
| pHandle | pointer to FOTA Agent handle |
- Returns
- SystemP_FAILURE
-
SystemP_SUCCESS
◆ FOTAAgent_getFLSOPSKDHandle()
Retrive FLSOPSKD handle.
- Parameters
-
| pHandle | [in] pointer to FOTA Agent handle |
| flsopskdHandle | [out] pointer to flsopskdHandle |
- Returns
- SystemP_FAILURE
-
SystemP_SUCCESS