RIOT "partition" header and tools.
More...
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
◆ riotboot_hdr_img_state
Image state enumeration.
| Enumerator |
|---|
| RIOTBOOT_HDR_IMG_STATE_INSTALLED | Image is installed (1111)
|
| RIOTBOOT_HDR_IMG_STATE_DEACTIVATED | Image is deactivated (1110)
|
| RIOTBOOT_HDR_IMG_STATE_ACTIVATED | Image is activated (1100)
|
| RIOTBOOT_HDR_IMG_STATE_CONFIRMED | Image is confirmed (1000)
|
| RIOTBOOT_HDR_IMG_STATE_DISMISSED | Image is dismissed (0000)
|
Definition at line 92 of file hdr.h.
◆ riotboot_hdr_checksum()
Calculate header checksum.
- Parameters
-
- Returns
- the checksum of the given riotboot_hdr
◆ riotboot_hdr_get_boot_count()
| unsigned riotboot_hdr_get_boot_count |
( |
const riotboot_hdr_t * |
riotboot_hdr | ) |
|
Get current image boot count.
- Parameters
-
- Returns
- boot counter
◆ riotboot_hdr_get_checksum()
| uint32_t riotboot_hdr_get_checksum |
( |
const riotboot_hdr_t * |
riotboot_hdr | ) |
|
Getter for the header checksum.
- Parameters
-
- Returns
- Checksum of the given riotboot_hdr
◆ riotboot_hdr_get_flags()
| uint32_t riotboot_hdr_get_flags |
( |
const riotboot_hdr_t * |
riotboot_hdr | ) |
|
Getter for riotboot flags.
- Parameters
-
- Returns
- Flags
◆ riotboot_hdr_get_img_state()
Get image state.
- Parameters
-
- Returns
- image state
◆ riotboot_hdr_get_magic_number()
| uint32_t riotboot_hdr_get_magic_number |
( |
const riotboot_hdr_t * |
riotboot_hdr | ) |
|
Getter for riotboot magic number.
- Parameters
-
- Returns
- Magic number
◆ riotboot_hdr_get_start_addr()
| uint32_t riotboot_hdr_get_start_addr |
( |
const riotboot_hdr_t * |
riotboot_hdr | ) |
|
Getter for riotboot start address.
- Parameters
-
- Returns
- Start address
◆ riotboot_hdr_get_version()
| uint32_t riotboot_hdr_get_version |
( |
const riotboot_hdr_t * |
riotboot_hdr | ) |
|
Getter for riotboot version.
- Parameters
-
- Returns
- Version number
◆ riotboot_hdr_is_v2()
Check if the header is version 2.
- Parameters
-
- Returns
- true if version is 2, false otherwise
◆ riotboot_hdr_print()
Print formatted riotboot_hdr_t to STDIO.
- Parameters
-
◆ riotboot_hdr_set_boot_count()
| void riotboot_hdr_set_boot_count |
( |
riotboot_hdr_t * |
riotboot_hdr, |
|
|
unsigned |
boot_count |
|
) |
| |
Set image boot count.
- Parameters
-
| [in] | riotboot_hdr | ptr to image header |
| [in] | boot_count | new boot count |
◆ riotboot_hdr_set_img_state()
Set image state.
- Parameters
-
| [in] | riotboot_hdr | ptr to image header |
| [in] | state | new image state |
- Returns
- 0 on success, -1 on failure
◆ riotboot_hdr_validate()
Validate image header.
- Parameters
-
- Returns
- 0 if OK
-
-1 if not OK