Facilitates the update process.
More...
#include <stdbool.h>
#include <stdint.h>
#include <cfg_soc.h>
#include "errorcode.h"
Go to the source code of this file.
Facilitates the update process.
Definition in file update.h.
Aborts the update.
May leave an invalid image in he persistent storage.
Definition at line 178 of file update.c.
bool updEnd |
( |
uint32_t * |
chunkLostList, |
|
|
uint32_t * |
chunksCount |
|
) |
| |
Ends the update.
Returns an array of chunks which have not been received or written correctly. When this function returns false
the update process will not be stopped.
- Parameters
-
chunkLostList | A pointer to an array of lost chunk indexes. |
chunksCount | The number of lost chunks. |
- Return values
-
true | Update completed, image valid. |
false | The update was not completed, update not ended. |
Definition at line 163 of file update.c.
bool updImgInfo |
( |
uint32_t |
imgNo, |
|
|
UpdImgInfo * |
imgInfo |
|
) |
| |
Retrieve image information for the specified location.
- Parameters
-
imgNo | The image number. |
imgInfo | Pointer to an image information structure to fill. |
- Return values
-
true | Command successful. |
false | Command failed, check error module for code and message |
Definition at line 193 of file update.c.
Initializes the update module.
Check whether or not protection of golden image is in place, and if not, puts it there.
Definition at line 64 of file update.c.
bool updIsUpdating |
( |
int * |
index | ) |
|
Returns whether or not the storage is in update mode.
- Parameters
-
index | The pointer is filled with the image currently updated, if at all. Index may be null. |
- Return values
-
true | The system is in update mode. |
false | The system is not in update mode. |
Definition at line 188 of file update.c.
Locks the golden image for writing.
Normally the golden image is locked after a succesful update.
- Return values
-
true | The image was locked |
false | The image was not locked. |
Definition at line 230 of file update.c.
bool updStart |
( |
int |
imageIdx, |
|
|
uint32_t |
chunkCount |
|
) |
| |
Starts an image update.
The password is required for the golden image (image index 0), once it is protected using the updProtectGolden() command.
- Parameters
-
imageIdx | The image index you wish to update. |
chunkCount | The no of chunks send. |
- Return values
-
true | System is ready to receive the updates. |
false | System is not ready to recieve the updates, check errCode(). |
Definition at line 81 of file update.c.
Unlocks the golden image for writing.
- Return values
-
true | The image was unlocked. |
false | The image was not unlocked. |
Definition at line 225 of file update.c.
bool updVerify |
( |
uint32_t |
imgNo, |
|
|
uint32_t |
chunkNo, |
|
|
uint8_t * |
chunk, |
|
|
bool * |
result |
|
) |
| |
Verify a chunk.
- Parameters
-
imgNo | The image number. |
chunkNo | The chunk number |
chunk | The chunk data |
result | pointer to the result, either true - they are the same, false - there are differences |
- Return values
-
true | Command successful. |
false | Command failed, check error module for code and message |
Definition at line 143 of file update.c.
bool updWrite |
( |
uint32_t |
chunkNo, |
|
|
uint8_t * |
chunk |
|
) |
| |
Write a update chunk.
- Parameters
-
chunkNo | The index of the chunk to write. |
chunk | Pointer to a array of chunkSize bytes. |
- Return values
-
true | Update chunk written. |
false | The update could not be written, check errCode(). |
Definition at line 102 of file update.c.