Go to the documentation of this file.
209 #ifndef VS_FIRMWARE_H
210 #define VS_FIRMWARE_H
219 namespace VirgilIoTKit {
224 typedef struct __attribute__((__packed__)) {
233 typedef struct __attribute__((__packed__)) {
236 uint8_t signatures[];
240 typedef struct __attribute__((__packed__)) {
291 const uint8_t *chunk,
514 #endif // VS_FIRMWARE_H
uint8_t vs_device_manufacture_id_t[VS_DEVICE_MANUFACTURE_ID_SIZE]
Manufacture ID type.
Definition: provision-structs.h:120
const vs_update_file_type_t * vs_firmware_update_file_type(void)
Return firmware file type for Update library.
Firmware descriptor.
Definition: firmware.h:224
File type information.
Definition: update.h:70
vs_status_e vs_firmware_load_firmware_descriptor(const uint8_t manufacture_id[VS_DEVICE_MANUFACTURE_ID_SIZE], const uint8_t device_type[VS_DEVICE_TYPE_SIZE], vs_firmware_descriptor_t *descriptor)
Load firmware descriptor.
uint16_t chunk_size
Chunk size.
Definition: firmware.h:227
vs_status_e vs_firmware_verify_firmware(const vs_firmware_descriptor_t *descriptor)
Verify firmware.
Security Module implementation.
Definition: secmodule.h:458
int vs_firmware_get_expected_footer_len(void)
Get expected firmware footer length.
void vs_firmware_hton_descriptor(vs_firmware_descriptor_t *desc)
hton conversion for descriptor
File information.
Definition: provision-structs.h:225
vs_status_e
Status code.
Definition: status_code.h:77
void vs_firmware_hton_header(vs_firmware_header_t *header)
hton conversion for header
vs_file_info_t info
File information.
Definition: firmware.h:225
#define VS_DEVICE_MANUFACTURE_ID_SIZE
Manufacture ID size.
Definition: provision-structs.h:111
#define VS_DEVICE_TYPE_SIZE
Device type size.
Definition: provision-structs.h:114
vs_status_e vs_firmware_save_firmware_chunk(const vs_firmware_descriptor_t *descriptor, const uint8_t *chunk, size_t chunk_sz, size_t offset)
Save firmware data.
Update interface for files downloading.
File version information.
Definition: provision-structs.h:216
uint8_t vs_device_type_t[VS_DEVICE_TYPE_SIZE]
Device type.
Definition: provision-structs.h:127
vs_status_e vs_firmware_get_own_firmware_descriptor(vs_firmware_descriptor_t *descriptor)
Get own firmware descriptor.
vs_update_interface_t * vs_firmware_update_ctx(void)
Return firmware Update interface.
Status codes and macroses.
vs_status_e vs_firmware_load_firmware_chunk(const vs_firmware_descriptor_t *descriptor, uint32_t offset, uint8_t *data, size_t buf_sz, size_t *data_sz)
Load firmware data.
uint8_t padding
Padding.
Definition: firmware.h:226
uint32_t firmware_length
Firmware length.
Definition: firmware.h:228
vs_status_e vs_firmware_delete_firmware(const vs_firmware_descriptor_t *descriptor)
Delete firmware.
void vs_firmware_ntoh_header(vs_firmware_header_t *header)
ntoh conversion for header
vs_status_e vs_firmware_save_firmware_descriptor(const vs_firmware_descriptor_t *descriptor)
Save firmware descriptor.
Storage element context.
Definition: storage_hal.h:221
vs_status_e vs_firmware_init(vs_storage_op_ctx_t *ctx, vs_secmodule_impl_t *secmodule, vs_device_manufacture_id_t manufacture, vs_device_type_t device_type, vs_file_version_t *ver)
Initialize firmware.
vs_status_e vs_firmware_deinit(void)
Destroy firmware module.
vs_status_e vs_firmware_compare_own_version(const vs_firmware_descriptor_t *new_descriptor)
Compare own firmware version with the given one.
vs_status_e vs_firmware_load_firmware_footer(const vs_firmware_descriptor_t *descriptor, uint8_t *data, size_t buff_sz, size_t *data_sz)
Load firmware footer.
Update interface context.
Definition: update.h:284
vs_status_e vs_firmware_save_firmware_footer(const vs_firmware_descriptor_t *descriptor, const uint8_t *footer)
Save firmware footer.
vs_status_e vs_firmware_install_firmware(const vs_firmware_descriptor_t *descriptor)
Install firmware.
Security Module implementations signatures.
void vs_firmware_ntoh_descriptor(vs_firmware_descriptor_t *desc)
ntoh conversion for descriptor
uint32_t app_size
Application size = firmware_length + fill_size + footer.
Definition: firmware.h:229