Image parser plugin.
Generic image parser interface for Silicon Labs bootloader.
int32_t parser_init |
( |
void * |
context, |
|
|
void * |
decryptContext, |
|
|
void * |
authContext, |
|
|
uint8_t |
flags |
|
) |
| |
Initialize the parser's context
- Parameters
-
context | Pointer to context for the parser implementation |
decryptContext | Pointer to context for decryption of parsed file |
authContext | Pointer to context for authentication of parsed file |
flags | Flags for parser support |
- Returns
- BOOTLOADER_OK if OK, error code otherwise.
Parse an image file in order to extract the binary and some metadata.
Pushes data into the image file parser to be parsed.
- Parameters
-
context | Pointer to the specific parser's context variable |
imageProperties | Pointer to the image file state variable |
buffer | Pointer to byte array containing data to parse |
length | Size in bytes of the data in buffer |
callbacks | Struct containing function pointers to be called by the parser to pass the extracted binary data back to BTL. |
- Returns
- BOOTLOADER_OK if OK, error code otherwise.
bool parser_requireAuthenticity |
( |
void |
| ) |
|
Check whether the parser requires images to be signed
- Returns
- True if authenticity is required, else false
bool parser_requireConfidentiality |
( |
void |
| ) |
|
Check whether the parser requires images to be encrypted
- Returns
- True if confidentiality is required, else false
uint32_t parser_getApplicationAddress |
( |
void |
| ) |
|
Return the start address of the application
- Returns
- start address of the application
uint32_t parser_getBootloaderUpgradeAddress |
( |
void |
| ) |
|
Return the start address of the bootloader upgrade location
- Returns
- start address of the bootloader upgrade location if upgrading is supported, otherwise 0.
Callback to tell the parser whether to accept the application upgrade present in the upgrade image.
- Parameters
-
[in] | app | Pointer to the application data structure contained in the upgrade image. |
- Returns
- True if the application is accepted, and the parser should continue. False if the application is rejected. If rejected, the parser will abort parsing the image file and return BOOTLOADER_ERROR_PARSER_REJECTED.