mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-25 02:35:22 +00:00
UpdateHub is an enterprise-grade solution which makes simple to remotely update all your embedded devices in the field. It handles all aspects related to sending Firmware Over-the-Air(FOTA) updates with maximum security and efficiency, while you focus in adding value to your product. Signed-off-by: Christian Tavares <christian.tavares@ossystems.com.br> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
25 lines
487 B
C
25 lines
487 B
C
/*
|
|
* Copyright (c) 2018 O.S.Systems
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include "updatehub_firmware.h"
|
|
|
|
bool updatehub_get_firmware_version(char *version, int version_len)
|
|
{
|
|
struct mcuboot_img_header header;
|
|
|
|
if (boot_read_bank_header(DT_FLASH_AREA_IMAGE_0_ID, &header,
|
|
version_len) != 0) {
|
|
return false;
|
|
}
|
|
|
|
snprintk(version, version_len, "%d.%d.%d",
|
|
header.h.v1.sem_ver.major,
|
|
header.h.v1.sem_ver.minor,
|
|
header.h.v1.sem_ver.revision);
|
|
|
|
return true;
|
|
}
|