Go to the source code of this file.
◆ FotaAgentP_BufferManager_BUFFERFULL
#define FotaAgentP_BufferManager_BUFFERFULL ((int32_t)-3) |
◆ FotaAgentP_BufferManager_ADDRESS_DISCONT
#define FotaAgentP_BufferManager_ADDRESS_DISCONT ((int32_t)-4) |
◆ FotaAgentP_BufferManager_ADDRESS_UNALIGNED
#define FotaAgentP_BufferManager_ADDRESS_UNALIGNED ((int32_t)-5) |
◆ FOTAAgent_BufferManager_init()
Initilize buffer manager state machine.
The role of this function is to init all the initial varaibles with some default varaibles and also the state machine to its initial state, if any.
- Parameters
-
fotaAgentHandle | pointer to fotaAgent handle |
- Returns
- SystemP_FAILURE
-
SystemP_SUCCESS
◆ FOTAAgent_BufferManager_update()
int32_t FOTAAgent_BufferManager_update |
( |
FOTAAgent_Handle * |
fotaAgentHandle, |
|
|
uint8_t |
newData, |
|
|
uint32_t |
flashOffset |
|
) |
| |
Update internal buffer with new data.
Udpate the internal buffer with new information. At any point of time, after calling this function with newData and flashOffset, this API will have the following information:
- size of internal buffer filled
- last address at which data is supposed to be written
In case, internal buffer is 4K, then, when internal buffer is full, at that time, this API will have data to be written and the address where it is be written.
- Parameters
-
fotaAgentHandle | pointer to fotaAgent handle. |
newData | new data. |
flashOffset | offset in flash at which it is supposed to be written. |
- Returns
- SystemP_FAILURE
-
SystemP_SUCCESS
◆ FOTAAgent_BufferManager_calculateFlushAddress()
int32_t FOTAAgent_BufferManager_calculateFlushAddress |
( |
FOTAAgent_Handle * |
fotaAgentHandle, |
|
|
uint32_t * |
addr |
|
) |
| |
Calculate Address at which internal buffer to be flushed at.abort.
Before flush function is called, this function is called internally, to calculate the address at which internal buffer is to be flushed.
This address is that this function calculate aligns with erase size.
- Parameters
-
- Returns
- int32_t
◆ FOTAAgent_BufferManager_flush()
Flush internal buffer to flash.
When this function is called, doesn't matter if the internal buffer is full or not, it will calculate the address aligned to erase size and write the interal buffer.
- Parameters
-
fotaAgentHandle | pointer to fotaAgent handle. |
- Returns
- SystemP_FAILURE
-
SystemP_SUCCESS
◆ FOTAAgent_BufferManager_checkAddressDiscontinuity()
int32_t FOTAAgent_BufferManager_checkAddressDiscontinuity |
( |
FOTAAgent_Handle * |
fotaAgentHandle, |
|
|
uint32_t |
address, |
|
|
uint8_t |
newData |
|
) |
| |
Check if the new data's address is discontinuous or not.
essentially this function returns (last_address - address) == sizeof(uint8_t).
- Parameters
-
fotaAgentHandle | pointer to fotaAgent handle. |
address | SOC address space of new data |
newData | new data byte |
- Returns
- SystemP_FAILURE
-
SystemP_SUCCESS